On Thu, Oct 18, 2001 at 10:53:11AM +0200, Mark Santcroos wrote:
> Hi David
> 
> >From sys/i386/include/ansi.h:
> 
> (1) #if defined __GNUC__
> (2) #if (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95)
> (3) #define _BSD_VA_LIST_   __builtin_va_list       /* internally known to gcc */
> (4) #endif
> (5) typedef _BSD_VA_LIST_ __gnuc_va_list;           /* compatibility w/GNU headers*/
> (6) #else
> (7) #define _BSD_VA_LIST_   char *                  /* va_list */
> (8) #endif /*__GNUC__*/
> 
> On my system, (1) is TRUE, (2) is FALSE, so in (5) _BSD_VA_LIST_ is
> undefined. (which breaks building a kernel, and probably more)
> 
> Placing a (7) before (5) solves the problem. 
> 
_BSD_VA_LIST_ is needed for non-GCC compilers as well.  Please
see attached for the correct patch.


Cheers,
-- 
Ruslan Ermilov          Oracle Developer/DBA,
[EMAIL PROTECTED]           Sunbay Software AG,
[EMAIL PROTECTED]          FreeBSD committer,
+380.652.512.251        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


On Thu, Oct 18, 2001 at 11:58:10AM +0300, Ruslan Ermilov wrote:
> The below change breaks 4.4-STABLE -> 5.0-CURRENT upgrade path:
> 
[...]
> : /usr/obj/CURRENT/usr/src/i386/usr/include/machine/ansi.h:78: syntax error before 
>`__gnuc_va_list'
> : /usr/obj/CURRENT/usr/src/i386/usr/include/machine/ansi.h:78: warning: type 
>defaults to `int' in declaration of `__gnuc_va_list'
> : /usr/obj/CURRENT/usr/src/i386/usr/include/machine/ansi.h:78: warning: data 
>definition has no type or storage class
> : *** Error code 1
[...]

> In 4.4-STABLE, the following are defined:
> 
> #define __GNUC__ 2
> #define __GNUC_MINOR__ 95
> 
> and _BSD_VA_LIST_ is undefined.  The attached patch should fix this.
> Also, the ia64/include/ansi.h doesn't have __GNUC__ version checks
> thus making it impossible to cross-upgrade from 4.4-STABLE i386 to
> 5.0-CURRENT ia64.  Has this been considered?
> 
The previous patch was bogus -- _BSD_VA_LIST_ is required for non-GCC
compilers as well.  The attached is believed to be the right version.


Cheers,
-- 
Ruslan Ermilov          Oracle Developer/DBA,
[EMAIL PROTECTED]           Sunbay Software AG,
[EMAIL PROTECTED]          FreeBSD committer,
+380.652.512.251        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age
Index: sys/alpha/include/ansi.h
===================================================================
RCS file: /home/ncvs/src/sys/alpha/include/ansi.h,v
retrieving revision 1.18
diff -u -r1.18 ansi.h
--- sys/alpha/include/ansi.h    2001/10/18 00:27:37     1.18
+++ sys/alpha/include/ansi.h    2001/10/18 09:18:09
@@ -72,11 +72,8 @@
 #define        _BSD_OFF_T_     long                    /* file offset */
 #define        _BSD_PID_T_     int                     /* process [group] */
 
-#if defined __GNUC__
-#if (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95)
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
 #define        _BSD_VA_LIST_   __builtin_va_list       /* internally known to gcc */
-#endif
-typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
 #else
 typedef struct {
        char *__base;
@@ -85,6 +82,10 @@
 } __va_list;
 #define        _BSD_VA_LIST_   __va_list               /* va_list */
 #endif /*__GNUC__*/
+
+#ifdef __GNUC__
+typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
+#endif
 
 /*
  * The rune type above is declared to be an ``int'' instead of the more natural
Index: sys/i386/include/ansi.h
===================================================================
RCS file: /home/ncvs/src/sys/i386/include/ansi.h,v
retrieving revision 1.28
diff -u -r1.28 ansi.h
--- sys/i386/include/ansi.h     2001/10/18 00:27:38     1.28
+++ sys/i386/include/ansi.h     2001/10/18 09:18:09
@@ -71,14 +71,15 @@
 #define        _BSD_OFF_T_     __int64_t               /* file offset */
 #define        _BSD_PID_T_     int                     /* process [group] */
 
-#if defined __GNUC__
-#if (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95)
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
 #define        _BSD_VA_LIST_   __builtin_va_list       /* internally known to gcc */
-#endif
-typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
 #else
 #define        _BSD_VA_LIST_   char *                  /* va_list */
 #endif /*__GNUC__*/
+
+#ifdef __GNUC__
+typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
+#endif
 
 /*
  * The rune type above is declared to be an ``int'' instead of the more natural
Index: sys/ia64/include/ansi.h
===================================================================
RCS file: /home/ncvs/src/sys/ia64/include/ansi.h,v
retrieving revision 1.11
diff -u -r1.11 ansi.h
--- sys/ia64/include/ansi.h     2001/10/18 00:27:38     1.11
+++ sys/ia64/include/ansi.h     2001/10/18 09:18:10
@@ -72,7 +72,7 @@
 #define        _BSD_OFF_T_     long                    /* file offset */
 #define        _BSD_PID_T_     int                     /* process [group] */
 
-#if defined __GNUC__
+#ifdef __GNUC__
 #define        _BSD_VA_LIST_   __builtin_va_list       /* internally known to gcc */
 typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
 #else
Index: sys/powerpc/include/ansi.h
===================================================================
RCS file: /home/ncvs/src/sys/powerpc/include/ansi.h,v
retrieving revision 1.10
diff -u -r1.10 ansi.h
--- sys/powerpc/include/ansi.h  2001/10/18 00:27:38     1.10
+++ sys/powerpc/include/ansi.h  2001/10/18 09:18:12
@@ -71,11 +71,8 @@
 #define        _BSD_OFF_T_     __int64_t               /* file offset */
 #define        _BSD_PID_T_     int                     /* process [group] */
 
-#if defined __GNUC__
-#if (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95)
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
 #define        _BSD_VA_LIST_   __builtin_va_list       /* internally known to gcc */
-#endif
-typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
 #else
 typedef struct {
        char __gpr;
@@ -86,6 +83,10 @@
 } __va_list;
 #define        _BSD_VA_LIST_   __va_list               /* va_list */
 #endif /*__GNUC__*/
+
+#ifdef __GNUC__
+typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
+#endif
 
 /*
  * The rune type above is declared to be an ``int'' instead of the more natural
Index: sys/sparc64/include/ansi.h
===================================================================
RCS file: /home/ncvs/src/sys/sparc64/include/ansi.h,v
retrieving revision 1.5
diff -u -r1.5 ansi.h
--- sys/sparc64/include/ansi.h  2001/10/18 00:27:39     1.5
+++ sys/sparc64/include/ansi.h  2001/10/18 09:18:12
@@ -72,14 +72,15 @@
 #define        _BSD_OFF_T_     long                    /* file offset */
 #define        _BSD_PID_T_     int                     /* process [group] */
 
-#if defined __GNUC__
-#if (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95)
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
 #define        _BSD_VA_LIST_   __builtin_va_list       /* internally known to gcc */
-#endif
-typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
 #else
 #define        _BSD_VA_LIST_   char *                  /* va_list */
 #endif /*__GNUC__*/
+
+#ifdef __GNUC__
+typedef _BSD_VA_LIST_ __gnuc_va_list;          /* compatibility w/GNU headers*/
+#endif
 
 /*
  * The rune type above is declared to be an ``int'' instead of the more natural


Reply via email to