[Dnsmasq-discuss] Build on ancient gcc

Jan 'RedBully' Seiffert redbully at cc.fh-luh.de
Sat Jul 12 06:37:15 BST 2008


RevRagnarok wrote:
> I have a virtual machine that I am trying to put the latest DNSMasq (2.43)
> onto. It currently has 1.14 installed from RPM (yes, its base install is
> from the PREVIOUS time there was a Red Hat 7). The gcc on it is ancient,
> 2.96.
> 
> Anyway, I am getting an error "dnsmasq.h:545: array size is missing in
> 'filename'"
> 

struct tftp_file {
   int refcount, fd;
   off_t size;
   dev_t dev;
   ino_t inode;
   char filename[];
};

This?
This is a C99 "variable-size-array"
GCC 2.96 doesn't fully support C99, but it can be worked around. These 
early gcc had an extension which basicaly does the same, only little 
different syntax. Put a zero between the two square brackets, like this:

struct tftp_file {
   int refcount, fd;
   off_t size;
   dev_t dev;
   ino_t inode;
   char filename[0];
};

maybe you also have to add "-std=gnu9x" to the CFLAGS.

> Has anybody seen this before? I checked the subjects of the most recent two
> archives. I know I need to upgrade that machine, but was hoping this
> wouldn't be hopeless. Thanks!
> 

Greeting
	Jan

-- 
Theres only 2 requirements in life, WD40 and Duck Tape.
If if doesnt move and it should use the WD40
If it moves and it shouldnt use the Duck Tape



More information about the Dnsmasq-discuss mailing list