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]

Don't override USER_H on FreeBSD, take 2


In article <3646.935564608@upchuck.cygnus.com>,
Jeffrey A Law <law@cygnus.com> writes:

>> Mon Aug  2 16:43:34 CDT 1999 Loren Rittle  <ljrittle@acm.org>
...

> I do not think this patch is anywhere near complete.  Particularly the
> stddef.h changes.

...

> In general, given the uglyness of stddef.h a patch to it needs to be well
> understood.

Thank you for challenging my proposed stddef.h patch.  In retrospect,
it was not good.  Although I am ashamed that I hadn't before, I
reviewed the history of that file and discovered that someone fixed
the same problem that the FreeBSD port now displays due to removal of
the USER_H override for BSDI last year (which, as near as I can tell,
has never had a USER_H override).  Unfortunately, they installed a
very specific fix with a comment that although FreeBSD shared the same
macro guard for the machine/ansi.h file, it didn't need to see the
section of stddef.h which fixes the macro situation for BSD machines.
The reason that the FreeBSD port didn't need that section was that,
with the USER_H override, stddef.h wasn't being installed at all!

For this version of the patch, I have merely generalized the existing
check to handle any BSD system that defines _MACHINE_ANSI_H_ instead
of _ANSI_H_ as the macro guard for machine/ansi.h.  This macro check
is now identical to the one used earlier in the file right after the
machine/ansi.h file is included for BSD systems.

> I believe you also need update varargs.h in a manner similar to stdarg.h.

Agreed.  In fact, during further review prompted by your comments, I
noted that when patches for NetBSD were installed, they only hit
stdarg.h.  I fixed that obvious buglet as well.

This patch has been bootstrapped and regression tested on FreeBSD 3.2
against the 19990824 snapshot.  The list of failures was expected
based upon 2.95 failures and those of other targets reported for this
snapshot.

Regards,
Loren

Wed Aug 25 04:27:11 CDT 1999  Loren Rittle  <ljrittle@acm.org>

    * config/t-freebsd: Do not override USER_H.
    * ginclude/stddef.h: Generalize check for _MACHINE_ANSI_H_.
    * ginclude/stdarg.h: Adhere to definition of va_list in FreeBSD
    system headers.
    * ginclude/varargs.h: Likewise and make NetBSD definition of va_list
    consistent with that expressed in ginclude/stdarg.h.

Index: config/t-freebsd
===================================================================
RCS file: /cvs/egcs/egcs/gcc/config/t-freebsd,v
retrieving revision 1.2
diff -c -3 -p -r1.2 t-freebsd
*** t-freebsd   1999/06/02 00:08:20     1.2
--- t-freebsd   1999/08/25 11:05:25
***************
*** 1,4 ****
  # Don't run fixproto
  STMP_FIXPROTO =
- # Use only native include files
- USER_H = $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
--- 1,2 ----
Index: ginclude/stddef.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/ginclude/stddef.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 stddef.h
*** stddef.h    1998/12/16 21:19:25     1.4
--- stddef.h    1999/08/25 11:05:25
*************** typedef __WINT_TYPE__ wint_t;
*** 284,292 ****
  
  /*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
      are already defined.  */
! /*  BSD/OS 3.1 requires the MACHINE_ANSI_H check here.  FreeBSD 2.x apparently
!     does not, even though there is a check for MACHINE_ANSI_H above.  */
! #if defined(_ANSI_H_) || (defined(__bsdi__) && defined(_MACHINE_ANSI_H_))
  /*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
      are probably typos and should be removed before 2.8 is released.  */
  #ifdef _GCC_PTRDIFF_T_
--- 284,291 ----
  
  /*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
      are already defined.  */
! /*  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.  */
! #if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
  /*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
      are probably typos and should be removed before 2.8 is released.  */
  #ifdef _GCC_PTRDIFF_T_
*************** typedef __WINT_TYPE__ wint_t;
*** 314,320 ****
  #undef _WCHAR_T_
  #undef _BSD_WCHAR_T_
  #endif
! #endif /* _ANSI_H_ || ( __bsdi__ && _MACHINE_ANSI_H_ ) */
  
  #endif /* __sys_stdtypes_h */
  
--- 313,319 ----
  #undef _WCHAR_T_
  #undef _BSD_WCHAR_T_
  #endif
! #endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
  
  #endif /* __sys_stdtypes_h */
  
Index: ginclude/stdarg.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/ginclude/stdarg.h,v
retrieving revision 1.9
diff -c -3 -p -r1.9 stdarg.h
*** stdarg.h    1999/05/08 01:52:35     1.9
--- stdarg.h    1999/08/25 11:05:26
***************
*** 67,73 ****
  
  #ifndef __GNUC_VA_LIST
  #define __GNUC_VA_LIST
! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
  typedef char *__gnuc_va_list;
  #else
  typedef void *__gnuc_va_list;
--- 67,73 ----
  
  #ifndef __GNUC_VA_LIST
  #define __GNUC_VA_LIST
! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__) || defined(__FreeBSD__)
  typedef char *__gnuc_va_list;
  #else
  typedef void *__gnuc_va_list;
Index: ginclude/varargs.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/ginclude/varargs.h,v
retrieving revision 1.11
diff -c -3 -p -r1.11 varargs.h
*** varargs.h   1999/07/07 00:18:05     1.11
--- varargs.h   1999/08/25 11:05:26
*************** typedef int __builtin_va_alist_t __attri
*** 101,107 ****
  
  #ifndef __GNUC_VA_LIST
  #define __GNUC_VA_LIST
! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
  typedef char *__gnuc_va_list;
  #else
  typedef void *__gnuc_va_list;
--- 101,107 ----
  
  #ifndef __GNUC_VA_LIST
  #define __GNUC_VA_LIST
! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__) || defined(__FreeBSD__)
  typedef char *__gnuc_va_list;
  #else
  typedef void *__gnuc_va_list;


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