In message <[email protected]> Ron <[email protected]> wrote:
> In message <[email protected]> > Ron <[email protected]> wrote: >> I have a compiler error with >> static enum { RESET, RAW, CBREAK } ttystate = RESET; >> >> It seems that RAW and CBREAK are defined in <sys/ioctl> but there is >> nothing around for RESET. >> > OK, It compiles if I change the spelling of RAW and CBREAK to an unknown. > So it may be that the problem is that those two have been defined, and > this function wants to set them at 0, 1, 2 ? The above is perfectly valid code, but any perfectly valid code that makes use of identifiers or keywords can be broken by previous #defines. If the file with the above code #includes <sys/ioctl.h>, which #defines RAW and CBREAK as numeric constants, then you get a compiler error because the compiler sees numbers instead of the identifiers RAW and CBREAK in the enum declaration. That is a name conflict between this code and the contents of <sys/ioctl.h>. At a guess, the above code was meant to be used as a fallback implementation on platforms that do not have <sys/ioctl.h> available. Martin -- --------------------------------------------------------------------- Martin Wuerthner MW Software [email protected] --------------------------------------------------------------------- _______________________________________________ GCCSDK mailing list [email protected] Bugzilla: http://www.riscos.info/bugzilla/index.cgi List Info: http://www.riscos.info/mailman/listinfo/gcc Main Page: http://www.riscos.info/index.php/GCCSDK
