From owner-freebsd-current Sun Apr 23 10:42: 7 2000 Delivered-To: freebsd-current@freebsd.org Received: from hun.org (hun.org [216.190.28.252]) by hub.freebsd.org (Postfix) with ESMTP id 5701E37B688 for ; Sun, 23 Apr 2000 10:42:03 -0700 (PDT) (envelope-from attila@hun.org) Received: (from attila@localhost) by hun.org (8.9.3/8.9.2) id RAA00425; Sun, 23 Apr 2000 17:41:53 GMT (envelope-from attila) Date: Sun, 23 Apr 2000 17:41:53 GMT Message-Id: <200004231741.RAA00425@hun.org> From: attila! Organization: hun.org, over 40 years beyond the fringe home for unpenitent hackers and anarcho-cryptophreaks Mailer: FreeBSD 4.0-current with XEmacs V20.4 (see alt.religion.emacs) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit; Content-Disposition: Inline Cc: Bruce Evans To: freebsd-current@FreeBSD.ORG Subject: on the road to stomping out __func__ Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG you're correct (see reply from Bruce Evans below) __func__ is in /usr/src/contrib/gcc/c-common.c ChangeLog:9854: `__func__'. c-common.c:164:/* Make bindings for __FUNCTION__, __PRETTY_FUNCTION__, and __func__. */ c-common.c:190: declare_hidden_char_array ("__func__", name); which, if as indicated in ChangeLog:9854 Tue Dec 1 20:49:49 1998 Ulrich Drepper Stephen L Moshier Richard Henderson * c-common.c (declare_function_name): Declare predefined variable `__func__'. makes me question why the gcc compiler which I believe was in use for 4.0-CURRENT prior to 21 Jul 99, does not include the declaration, particularly since the compiler used for the compile was based on a CURRENT cvsup of 29 Jun 99.... However, that still leaves me between a rock and a hard spot! Kernel usage appears limited solely to two error statements in /usr/src/sys/i386/i386/cksum.c in_cksum.c: 238 if (len) 239 printf("%s: out of data by %d\n", __func__, len); 426 if (len) 427 printf("%s: out of data by %d\n", __func__, len); Which is easily enough circumvented (kludged): 238 if (len) 243 printf("%s: out of data by %d\n", "in_cksum", len); 431 if (len) 435 printf("%s: out of data by %d\n", "in_cksum_skip", len); Which is an abomination... and like Bruce, I question the need for __func__ at this point... But, beggars can not be choosers, and, it does compile, without errors, both GENERIC and the target 'hun'. And, even better, it appears to execute X from 4.0-CURRENT along with Xemacs, pine, xshisen (great during long compiles) etc. --what more could I ask for? Easy, a good 'make world' and update of /etc files. since my cvsup is from 000422.1619 UCT, maybe JKH's 'BOTD' in netstat.c had not crept in... On Sun, 23 Apr 2000, Bruce Evans wrote: + On Sat, 22 Apr 2000, attila! wrote: + + > '__func__ is not found for either the 'GENERIC' or 'hun' target. + + __func__ is a new feature in C99. It is an alias for the gcc feature + __FUNCTION_NAME. Both give the name of the current function as a string. + + This feature should not be used until C99 becomes Normal, if ever. + Using it breaks portability. It apparently even breaks compiling + current kernels with the version of gcc in FreeBSD-3.4. I think + __func__ was added in egcs (the Changelog entry for adding it in gcc + is dated Dec 1 1998). + To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message