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: Fix bootstrap on non-C99 systems


 > My opinion is, if libiberty is ensuring a function's presense,
 > libiberty should ensure the function's prototype as well, if needed.
 > The "if needed" part is the difficult part, because gcc can't
 > [currently] use libiberty's configure results to properly configure
 > libiberty.h.  Hence the HAVE_DECL_ stuff.
 > 
 > If we can figure out a way to use libiberty's configury to configure
 > libiberty.h for other projects, a lot of gcc/system.h could be moved
 > to libiberty.h.

The problem of having libiberty check for a decl and provide it is
that the decl check is highly sensitive to which system headers you
happen to include during the decl check.

If the set of system headers during the check is not identical to
those used during compilation, you'll likely get a mismatch.  I.e. you
think you have the prototype but really don't in the set of headers
you happen to include, or the reverse situation.

When we run the decl checks in the gcc directory, we specifically tell
autoconf to include gcc/system.h so that we ensure an exact match
between the decl check's system headers and compiled code's system
headers.

If we proxy the testing out to libiberty, it becomes much harder to
synchronize what headers to include in the check across the multiple
projects which use libiberty.

What I think we could do more easily, is to move all the backup
prototypes from system.h to libiberty.h but leave the configure tests
where they are as the responsibility of the package making use of
libiberty.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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