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

[Bug preprocessor/55115] [>=4.5.0 regression] missing headers as fatal breaks cproto logic


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55115

--- Comment #3 from Pierre Poissinger <pierre.poissinger at gmail dot com> 2012-10-29 14:42:09 UTC ---
Hi,

Typically: The header is used, and contains all the 'visible' functions found
in source BUT it's only needed:
a) To perform real compilation: To check that function called are called
correctly
b) As export/header for the lib.

cproto only preproc the file via -E option.

Quick 'real life' example:
myfuncs.h: Auto generated proto, generated out of a.c and b.c
a.c: Define a(), calls b() - include 'myfuncs.h'
b.c: Define b() - include 'myfuncs.h'

=> the "include" of the generated myfuncs.h file is to avoid local definitions
+ allow early check if functions signature changes for whatever reasons.

Now - myfuncs.h being auto generated, during first build, prototyping will fail
quickly due to "Missing headers"... 
This create some kind of a "Chicken/Egg" problem :-)

If adding an option is annoying: Maybe then the 'fatal' should not be enforced
if run is limited to preproc only, aka '-E' ?


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