This is the mail archive of the gcc-bugs@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]

problem porting using gcc on LYNX OS


I am trying to compile a program that seem to be having a scope problem on
LYNX using GCC.  I works with other compilers.  The '-traditional' cc
option doesn't work. Below is a small example program that demonstrates the
problem:

TEST.C
#include <stdio.h>

struct check {
     int a;
     char b;
     };

int tmp;
void print_next();

void main()
{

        tmp = 5;
        printf("main: tmp = %d\n",tmp);
        
        print_next();
}       
 
TEST1.C
struct check {
     int a;
     char b;
     };

int tmp;
void print_next()
{

        tmp=6;
        printf("print_next: tmp = %d\n",tmp);
}


This program generated the following errors:
/usr/tmp/cc1392.o(.bss+0x0):test1.c: multiple definition of `tmp'
/usr/tmp/cc1391.o(.bss+0x0):test.c: first defined here

Thanks,
Sandra

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