[K42-discussion] [PATCH] These macros declare functions as both 'extern' and 'static'. This is strongly discouraged by the c++ spec and gcc 4 will not allow it. Instead, iso c++ suggests wrapping your extern functions in anonymous namespaces. See ISO-14882 7.3.1.1. Compiles correctly with both gcc 3 and gcc 4.1.
Bryan S Rosenburg
rosnbrg at us.ibm.com
Thu Oct 5 07:34:51 EST 2006
I don't have any particular objection to the namespace{} solution. I wish
namespaces had been available early in the K42 project.
However, in this case I don't think the problematic functions need to be
either static or extern "C". I'd probably keep the static attributes on
general principles, and you have to keep the extern "C" attributes on the
__k42_linux_##x declarations and on the __k42_linux_emulNoSupport
declarations, because those routines really are external, but all the
others are defined and used in the same file, so extern "C" linkage isn't
needed.
- Bryan
Donour Sizemore <donour at cs.unm.edu>
Sent by: k42-discussion-bounces+rosnbrg=us.ibm.com at ozlabs.org
10/02/2006 07:28 PM
Please respond to
Discussion about K42 <k42-discussion at ozlabs.org>
To
Discussion about K42 <k42-discussion at ozlabs.org>
cc
Subject
Re: [K42-discussion] [PATCH] These macros declare functions as both
'extern' and 'static'. This is strongly discouraged by the c++ spec and
gcc 4 will not allow it. Instead, iso c++ suggests wrapping your extern
functions in anonymous namespaces. See ISO-14882 7.3.1.1. Compiles
correctly with both gcc 3 and gcc 4.1.
If the commit mesg for this one is hard to read, here's it again.
[PATCH] These macros declare functions as both 'extern' and 'static'.
This is strongly discouraged by the c++ spec and gcc 4 will not allow
it. Instead, iso c++ suggests wrapping your extern functions in
anonymous namespaces. See ISO-14882 7.3.1.1. Compiles correctly with
both gcc 3 and gcc 4.1.
Thanks to Matthew Barrick for pointing out the correct solution to this
one.
donour
_______________________________________________
K42-discussion mailing list
K42-discussion at ozlabs.org
https://ozlabs.org/mailman/listinfo/k42-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/k42-discussion/attachments/20061004/c5977a77/attachment.htm
More information about the K42-discussion
mailing list