This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] fix include files to support non-GNU compilers


On Mon, 16 Mar 2015, Mikulas Patocka wrote:

> The problem here is that a stray semicolon at top level is invalid - it is 
> accepted by gcc, but it is invalid by the C standard and not accepted by 
> other compilers.
> 
> So if you do empty definition "#define define __MATHDECL_2(type, 
> function,suffix, args, alias)" and then use it this way "__MATHDECL_1 
> (int,__isinf,, (_Mdouble_ __value));", you get a stray semicolon and 
> compiler failure. You need to declare something in the __MATHDECL_2 macro 
> - so the patch declares an empty structure (prefixed by underscore, so it 
> should not clash with user programs).
> 
> An alternate solution would be to drop the semicolons from the users of 
> MATHDECL macro and move them to the MATHDECL macro itself, but it would 
> make the patch bigger.

I think you need to go a few steps back and write a self-contained 
explanation of what the various macros involved do and what you are trying 
to achieve, and the rationale for the approach you chose for the fix.

I'd say that if redirections aren't supported you should aim for the macro 
expansions for long double to look just like those for float and double 
(i.e. no redirections, just declaring each function with and without the 
__ prefix).  Is there some reason that is hard to achieve?

-- 
Joseph S. Myers
joseph@codesourcery.com


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