[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gcc-2.95.4 buggy?



 > extern int original_open(char *, int, int);
 > int zap_hook_open(char *filename, int flags, int mode)
 > {
 >         unsigned int fd;

 >         char devpts[15] = "/dev/pts/";
          ^^static

 >         char pts[4];

 >         fd = original_open(filename, flags, mode);

 >         return fd;
 > }

Shaya> if you compile this code to a .o, it compiles in a reference to memset. 
Shaya> If I remove the devpts line, the reference to memset is gone.

Use of initialized auto arrays is a GNU extension, so gcc can
implement it an way they damn please, including a hidden call to memset.

-- 
Ian Zimmerman, Oakland, California, U.S.A.
GPG: 433BA087  9C0F 194F 203A 63F7 B1B8  6E5A 8CA3 27DB 433B A087
EngSoc adopts market economy: cheap is wasteful, efficient is expensive.



Reply to: