This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [c/c++ (rfa)] fix 32455


Jakub Jelinek wrote:
On Sun, Feb 10, 2008 at 11:31:01AM -0800, Mark Mitchell wrote:
Richard Henderson wrote:
On Wed, Feb 06, 2008 at 09:24:14PM +0100, Richard Guenther wrote:
We reject __builtin_field, but not __builtin_struct?  What happens
if you re-declare the __builtin_va_list type?
Err, probably bad things. I'll see about fixing that too.
I think it's a good idea to completely forbid declarations of __builtin things and I think the C++ parts of the patch are fine. However, I do expect we'll see some fallout from people who have header files that do declare __builtins. Perhaps for 4.3 we should make this an unconditional warning, and indicate that in 4.4 it will go away completely?

glibc internal headers declare some __builtin_* functions in order to add some __asm ("name") to them to override what symbol is used for them if not optimized out. I think we should only error out if declaring __builtin_* types or if explicit __builtin_* function declaration has non-matching types.

Do we think that ought to be an acceptable thing for GLIBC to do?


I guess I don't think it is. GLIBC is just a library, albeit a very important one. These are the compiler's magic functions and it's free to do what it likes with them. Your suggestion also won't future-proof people against us adding new builtins which is one of the risks. For example, I've seen people write __builtin_xyz functions as ordinary functions to try to mimic what we do for assembly intrinsics. Then, if we add that as a real intrinsic in the future, there will be a conflict.

I'd prefer that we just declare the __builtin namespace off-limits for user declarations.

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]