Bug 13601 - declaration of structure variable errno busts syntax parser
Summary: declaration of structure variable errno busts syntax parser
Status: RESOLVED DUPLICATE of bug 13600
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.2.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-07 16:53 UTC by Sam Hopkins
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Hopkins 2004-01-07 16:53:24 UTC
[sah@roscoe tmp]$ cat hw.c
#include <stdio.h>
#include <errno.h>

typedef struct s {
        char *errno;
} S;

int
main(void)
{
        S s;

        s.errno = "hello world";
        printf("%s\n", s.errno);

        return 0;
}
[sah@roscoe tmp]$ gcc -v -save-temps hw.c
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--disable-checking --with-system-zlib --enable-__cxa_atexit 
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/cpp0 -lang-c -v -D__GNUC__=3 
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__ 
-Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ 
-D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ hw.c hw.i
GNU CPP version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/cc1 -fpreprocessed hw.i -quiet 
-dumpbase hw.c -version -o hw.s
GNU CPP version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) (cpplib) (i386 Linux/ELF)
GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) (i386-redhat-linux)
        compiled by GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
hw.c:5: field `__errno_location' declared as a function
hw.c: In function `main':
hw.c:13: parse error before '(' token
hw.c:14: parse error before '(' token
[sah@roscoe tmp]$

Get hw.i from: http://www.softcardsystems.com/sah/hw.i

Cheers,

Sam
Comment 1 Wolfgang Bangerth 2004-01-07 17:36:24 UTC
Duplicate of PR 13600. 

*** This bug has been marked as a duplicate of 13600 ***