This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12003] New: FILE* variable initialized to stderr (not constant error)
- From: "Castalia at idaeim dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Aug 2003 04:12:08 -0000
- Subject: [Bug c/12003] New: FILE* variable initialized to stderr (not constant error)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12003
Summary: FILE* variable initialized to stderr (not constant
error)
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Castalia at idaeim dot com
CC: gcc-bugs at gcc dot gnu dot org
The code:
#include <stdio.h>
FILE *OUTPUT = stderr;
main ()
{
fprintf (OUTPUT, "Try this!\n");
exit (0);
}
Fails to build:
idaeim:castalia>> gcc try.c -o try
try.c:4: error: initializer element is not constant
idaeim:castalia>> gcc --version
gcc (GCC) 3.3.1 [FreeBSD]
idaeim:castalia>> uname -a
FreeBSD idaeim 4.8-STABLE FreeBSD 4.8-STABLE #0: Sun Jul 13 13:11:51 MST
2003 root@idaeim:/usr/obj/usr/src/sys/IDAEIM i386
N.B.: The same problem occurs with gcc 3.2.1,
but it does NOT occur with gcc 3.2.2 for Solaris.