public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: target/1538: cannot compile with #include <sys/varargs.h>
Date: Fri, 29 Mar 2002 01:06:00 -0000	[thread overview]
Message-ID: <20020329090601.20571.qmail@sources.redhat.com> (raw)

The following reply was made to PR target/1538; it has been noted by GNATS.

From: Richard Henderson <rth@redhat.com>
To: "Garrett D'Amore" <garrett@damore.org>
Cc: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: target/1538: cannot compile with #include <sys/varargs.h>
Date: Fri, 29 Mar 2002 01:00:22 -0800

 On Fri, Mar 29, 2002 at 12:37:30AM -0800, Garrett D'Amore wrote:
 > The "standard" to which you refer is for *USERLAND* code only.  When you
 > compile kernel code for Solaris, you are not supposed to use this header
 > since it might introduce other (conflicting) symbols.  The Solaris DDI
 > specifies the use of <sys/varargs.h> for builing devices drivers and other
 > kernel code.
 
 That certainly was not clear to me from your report.  It certainly
 looked like someone being fresh with the internals of Solaris varargs.
 
 > It would be very nice if gcc knew that on Solaris <sys/varargs.h> is
 > basically the same as <stdarg.h> and fixincludes automagically took care
 > of this.  Which is why I filed the request.
 
 Ok.  If you're still interested, please try the following vs
 a gcc 3.1 snapshot.
 
 
 r~
 
 
 	* fixinc/inclhack.def (solaris_sys_varargs_h): New.
 	* fixinc/fixincl.x: Regenerate.
 
 Index: fixincl.x
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/fixinc/fixincl.x,v
 retrieving revision 1.119
 diff -c -p -d -r1.119 fixincl.x
 *** fixincl.x	2002/03/22 02:24:51	1.119
 --- fixincl.x	2002/03/29 08:57:49
 ***************
 *** 5,11 ****
    * files which are fixed to work correctly with ANSI C and placed in a
    * directory that GNU C will search.
    *
 !  * This file contains 140 fixup descriptions.
    *
    * See README for more information.
    *
 --- 5,11 ----
    * files which are fixed to work correctly with ANSI C and placed in a
    * directory that GNU C will search.
    *
 !  * This file contains 141 fixup descriptions.
    *
    * See README for more information.
    *
 *************** static const char* apzSolaris_Stdio_TagP
 *** 3696,3701 ****
 --- 3696,3729 ----
   
   /* * * * * * * * * * * * * * * * * * * * * * * * * *
    *
 +  *  Description of Solaris_Sys_Varargs_H fix
 +  */
 + tSCC zSolaris_Sys_Varargs_HName[] =
 +      "solaris_sys_varargs_h";
 + 
 + /*
 +  *  File name selection pattern
 +  */
 + tSCC zSolaris_Sys_Varargs_HList[] =
 +   "|sys/varargs.h|";
 + /*
 +  *  Machine/OS name selection pattern
 +  */
 + tSCC* apzSolaris_Sys_Varargs_HMachs[] = {
 +         "*-*-solaris*",
 +         (const char*)NULL };
 + #define SOLARIS_SYS_VARARGS_H_TEST_CT  0
 + #define aSolaris_Sys_Varargs_HTests   (tTestDesc*)NULL
 + 
 + /*
 +  *  Fix Command Arguments for Solaris_Sys_Varargs_H
 +  */
 + static const char* apzSolaris_Sys_Varargs_HPatch[] = {
 + "#include <stdarg.h>",
 +     (char*)NULL };
 + 
 + /* * * * * * * * * * * * * * * * * * * * * * * * * *
 +  *
    *  Description of Statsswtch fix
    */
   tSCC zStatsswtchName[] =
 *************** static const char* apzX11_SprintfPatch[]
 *** 5506,5512 ****
    */
   #define REGEX_COUNT          149
   #define MACH_LIST_SIZE_LIMIT 279
 ! #define FIX_COUNT            140
   
   /*
    *  Enumerate the fixes
 --- 5534,5540 ----
    */
   #define REGEX_COUNT          149
   #define MACH_LIST_SIZE_LIMIT 279
 ! #define FIX_COUNT            141
   
   /*
    *  Enumerate the fixes
 *************** typedef enum {
 *** 5605,5610 ****
 --- 5633,5639 ----
       SCO_UTIME_FIXIDX,
       SOLARIS_MUTEX_INIT_FIXIDX,
       SOLARIS_STDIO_TAG_FIXIDX,
 +     SOLARIS_SYS_VARARGS_H_FIXIDX,
       STATSSWTCH_FIXIDX,
       STDIO_STDARG_H_FIXIDX,
       STDIO_VA_LIST_FIXIDX,
 *************** tFixDesc fixDescList[ FIX_COUNT ] = {
 *** 6119,6124 ****
 --- 6148,6158 ----
        apzSolaris_Stdio_TagMachs,
        SOLARIS_STDIO_TAG_TEST_CT, FD_MACH_ONLY,
        aSolaris_Stdio_TagTests,   apzSolaris_Stdio_TagPatch, 0 },
 + 
 +   {  zSolaris_Sys_Varargs_HName,    zSolaris_Sys_Varargs_HList,
 +      apzSolaris_Sys_Varargs_HMachs,
 +      SOLARIS_SYS_VARARGS_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
 +      aSolaris_Sys_Varargs_HTests,   apzSolaris_Sys_Varargs_HPatch, 0 },
   
     {  zStatsswtchName,    zStatsswtchList,
        apzStatsswtchMachs,
 Index: inclhack.def
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
 retrieving revision 1.122
 diff -c -p -d -r1.122 inclhack.def
 *** inclhack.def	2002/03/22 02:24:52	1.122
 --- inclhack.def	2002/03/29 08:57:49
 *************** fix = {
 *** 2077,2082 ****
 --- 2077,2094 ----
   
   
   /*
 +  * Solaris <sys/varargs.h> is a DDK (aka kernel-land) header providing
 +  * the same interface as <stdarg.h>.  No idea why they couldn't have just
 +  * used the standard header.
 +  */
 + fix = {
 +     hackname = solaris_sys_varargs_h;
 +     files    = "sys/varargs.h";
 +     mach     = '*-*-solaris*';
 +     replace  = "#include <stdarg.h>";
 + };
 + 
 + /*
    *  Sony NEWSOS 5.0 does not support the complete ANSI C standard.
    */
   #ifdef SONY


             reply	other threads:[~2002-03-29  9:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-29  1:06 Richard Henderson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-01 17:47 rth
2002-03-29  1:06 rth
2002-03-29  0:46 Garrett D'Amore
2002-03-28 23:59 rth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020329090601.20571.qmail@sources.redhat.com \
    --to=rth@redhat.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).