From: Branan R. <br...@gm...> - 2008-08-24 03:30:55
|
Could be a different version of MSVC giving different warnings. On Sat, Aug 23, 2008 at 8:25 PM, Henri Häkkinen <hen...@gm...> wrote: > Right :) > > Hmm, someone reported that MSVC was giving warnings from anonymous > structs... Odd > > > On Sun, Aug 24, 2008 at 6:22 AM, Jason McKesson <ko...@gm...> wrote: >> >> Henri Häkkinen wrote: >> > Indeed. At the moment, I don't have an access to a Windows box, but >> > could somebody who has, kindly test out the possibility of this. >> > >> > Does the MSVC produce warnings, when you try to compile something like >> > this: >> > >> > typedef struct FOO_s { >> > union { >> > struct { >> > int di; >> > }; >> > in do; >> > }; >> > } FOO; >> > >> > int main() >> > { >> > FOO f; >> > f.di = 1; >> > f.do = 2; >> > return 0; >> > } >> No, but I can't imagine GCC does. That's because "do" is a C keyword ;) >> >> When you change it to be a regular identifier, it compiles fine. I even >> switched the order of the struct and the int, and it still works. >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Glsdk-devel mailing list >> Gls...@li... >> https://lists.sourceforge.net/lists/listinfo/glsdk-devel > > > > -- > Henri 'henux' Häkkinen > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Glsdk-devel mailing list > Gls...@li... > https://lists.sourceforge.net/lists/listinfo/glsdk-devel > > |