This is the mail archive of the gcc@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]

Lazy default attributes


I'd like to implement lazy default attributes: rather than pre-adding
certain format attributes to a list of names, or declaring exit and abort
as builtins just to get the noreturn attributes, I'd like to arrange for
the relevant attributes to be added when the function gets declared
(explicitly or implicitly) with a compatible type.  Some questions:

* Should these declarations be governed by flag_no_builtin /
flag_no_nonansi_builtin consistently, rather than (as at present) those
flags for the noreturn attributes and separate flags (flag_hosted,
flag_noniso_default_format_attributes) for the format attributes?

* What is the right way for common code - used by C, C++ and Objective-C -
to determine whether a declared function type is compatible with the type
of the (C standard or otherwise) function for which the attribute would be
added, with the exception used for builtins of allowing another pointer
type to override the builtin void * (so that fprintf etc. can be covered)?
(While we could ignore this matter for the standard functions, we also
support some non-standard functions, or functions standard in C99 only,
for which we do want to discard the attribute silently if the type is
wrong.)

* What is the correct test for C++ that the function is the standard one
we know the behavior of - being declared, we hope, by a standard header -
that works for the various variant c/c_std/c_shadow headers libstdc++ has?

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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