On Thu, 14 Jun 2018, Martin Sebor wrote:

> There's a comment in the code about the weak checking being
> deliberate (the word harmless here suggests the author may
> not have fully appreciated all the conversions it allows):
> 
>         /* Accept harmless mismatch in function types.
>            This is for the ffs and fprintf builtins.  */
> 
> If you concerned about the change causing trouble in this
> context, then if there are legacy systems that GCC still
> supports that declare standard functions with non-standard
> signatures they should be taken into consideration somehow.

For fprintf and various related functions, you need to allow for the 
built-in function being declared without the compiler knowing what the 
FILE type will end up being a typedef for - i.e., you can't avoid having 
some special case somewhere for built-in functions using 
fileptr_type_node, if nothing else.

For other functions, the issue as per 
<https://gcc.gnu.org/ml/gcc-patches/2001-04/msg00435.html> may well have 
been bad types in some system headers such as "char *sprintf();".  To the 
extent that any such systems with bad (but ABI-compatible) types for some 
functions in system headers are still supported as GCC targets, I think it 
would be reasonable to say that fixincludes, not extra laxity in built-in 
function types, is the way to deal with the bad types in headers.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to