This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: anonymous struct problems


excellent. thanks for this pointer, that worked.

For future reference on this list, this flag seems to be mutually exclusive to the -pedantic flag,
as well as the (naturally) -ansi flag, both of which are enabled by default in KDevelop.



Ben


llewelly@xmission.com wrote:

Ben Guthro <bguthro@sequelimaging.com> writes:



I'm running into a problem that I did not have in previous versions of
gcc
(I'm running 3.3.2-1 - shipped with Redhat Fedora Core1)


previous versions of gcc only gave me warnings on this code:


typedef struct DigitalMonitorPhotometry
{
	union
	{
		struct
		{
			DMC Brightness;
			DMC Contrast;
			DMC RedGain;
			DMC GreenGain;
			DMC BlueGain;
			DMC RedBias;
			DMC GreenBias;
			DMC BlueBias;
		};
		struct
		{
			DMC dmp[8];
		};
	};
}DM_PHOTOMETRYSETUP;


However, now I get: error: ISO C++ prohibits anonymous structs

This used to be a worning under previous gcc versions.



If you really need this feature, try adding -fms-extensions to your CFLAGS. fsf gcc 3.3.3 will compile your code with -fms-extensions and 'typedef char DMC;', on i386 freebsd 5.2p2 .

See http://xrl.us/budy and search for '-fms-extensions'.








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