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: tzset claimed to be ANSI not POSIX in fix-header.c


Jonathan Larmour wrote:
gcc/fix-header.c incorrectly defines tzset() to be an ANSI symbol when in fact it is POSIX.1. I am developing on a system where a system header gets "fixed" to define tzset(), when tzset() doesn't in fact exist in this system. The attached patch, against GCC 3.3.2 fixes this (I have bootstrap problems with GCC 3.3.3 on target arm-elf). As well as the GCC 3.3 branch it should also be applied to the trunk.

2004-03-10 Jonathan Larmour <jifl@eCosCentric.com>

* fix-header.c: tzset() is POSIX not ANSI.

Sorry for not noticing, but tzset isn't the only function in this category. putenv() and kill() are also POSIX, not ANSI. Therefore please instead use the attached page and ChangeLog entry. Thanks!



2004-03-10 Jonathan Larmour <jifl@eCosCentric.com>


* fix-header.c: kill(), putenv() and tzset() are POSIX not ANSI.


Jifl -- eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts >>>>> Visit us in booth 2527 at the Embedded Systems Conference 2004 <<<<< March 30 - April 1, San Francisco http://www.esconline.com/electronicaUSA/ --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine
Index: fix-header.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fix-header.c,v
retrieving revision 1.84
diff -u -5 -p -r1.84 fix-header.c
--- fix-header.c	12 Aug 2002 22:44:30 -0000	1.84
+++ fix-header.c	11 Mar 2004 07:00:45 -0000
@@ -267,11 +267,12 @@ tan\0tanh\0" },
   /* Left out signal() - its prototype is too complex for us!
      Also left out "sigaction sigaddset sigdelset sigemptyset
      sigfillset sigismember sigpending sigprocmask sigsuspend"
      because these need sigset_t or struct sigaction.
      Most systems that provide them will also declare them.  */
-  { "signal.h", ANSI_SYMBOL, "kill\0raise\0" },
+  { "signal.h", ANSI_SYMBOL, "raise\0" },
+  { CONTINUED, POSIX1_SYMBOL, "kill\0" },
 
   { "stdio.h", ANSI_SYMBOL,
       "clearerr\0fclose\0feof\0ferror\0fflush\0fgetc\0fgetpos\0\
 fgets\0fopen\0fprintf\0fputc\0fputs\0fread\0freopen\0fscanf\0fseek\0\
 fsetpos\0ftell\0fwrite\0getc\0getchar\0gets\0perror\0\
@@ -286,13 +287,14 @@ tmpnam\0ungetc\0" },
      ignore these: "mblen mbstowcs mbstowc wcstombs wctomb"
      Left out getgroups, because SunOS4 has incompatible BSD and SVR4 versions.
      Should perhaps also add NULL */
   { "stdlib.h", ANSI_SYMBOL,
       "abort\0abs\0atexit\0atof\0atoi\0atol\0bsearch\0calloc\0\
-exit\0free\0getenv\0labs\0malloc\0putenv\0qsort\0rand\0realloc\0\
+exit\0free\0getenv\0labs\0malloc\0qsort\0rand\0realloc\0\
 srand\0strtod\0strtol\0strtoul\0system\0" },
   { CONTINUED, ANSI_SYMBOL|MACRO_SYMBOL, "EXIT_FAILURE\0EXIT_SUCCESS\0" },
+  { CONTINUED, POSIX1_SYMBOL, "putenv\0" },
 
   { "string.h", ANSI_SYMBOL, "memchr\0memcmp\0memcpy\0memmove\0memset\0\
 strcat\0strchr\0strcmp\0strcoll\0strcpy\0strcspn\0strerror\0\
 strlen\0strncat\0strncmp\0strncpy\0strpbrk\0strrchr\0strspn\0strstr\0\
 strtok\0strxfrm\0" },
@@ -337,11 +339,12 @@ WTERMSIG\0WNOHANG\0WNOTRACED\0" },
 
   { "termios.h", POSIX1_SYMBOL,
       "cfgetispeed\0cfgetospeed\0cfsetispeed\0cfsetospeed\0tcdrain\0tcflow\0tcflush\0tcgetattr\0tcsendbreak\0tcsetattr\0" },
 
   { "time.h", ANSI_SYMBOL,
-      "asctime\0clock\0ctime\0difftime\0gmtime\0localtime\0mktime\0strftime\0time\0tzset\0" },
+      "asctime\0clock\0ctime\0difftime\0gmtime\0localtime\0mktime\0strftime\0time\0" },
+  { CONTINUED, POSIX1_SYMBOL, "tzset\0" },
 
   { "unistd.h", POSIX1_SYMBOL,
       "_exit\0access\0alarm\0chdir\0chown\0close\0ctermid\0cuserid\0\
 dup\0dup2\0execl\0execle\0execlp\0execv\0execve\0execvp\0fork\0fpathconf\0\
 getcwd\0getegid\0geteuid\0getgid\0getlogin\0getpgrp\0getpid\0\

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