This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 8.0 (Build 201403101706) Operating System = Linux version 2.6.32-431.11.2.el6.centos.plus.x86_64 running on amd64 Java; VM; Vendor = 1.7.0_55 Runtime = Java HotSpot(TM) 64-Bit Server VM 24.55-b03 I have written the following test code to demonstrate a (rather obscure) error when writing C in Netbeans. The error also occurs when using MPLAB X (which is based on NetBeans). When initialising a struct containing a union, Netbean's editor's parser shows an error (test3). However, It does not show any error when initialising the union when not in a struct (test 0 and test1). This code compiles and runs correctly (even in the debugger) and changes the value of answer to -299990: /*-----------------------------------------------------------------------------------------------------------*/ typedef union { unsigned char unsignedChar; long signedLong; } UnionTypeTest; typedef struct { long answer; UnionTypeTest testData; } UnionMemberStruct; /* No errors here */ UnionTypeTest test0 = {.signedLong = (long) - 100000}; UnionTypeTest test1 = {.unsignedChar = (unsigned char) 10}; /* BUG: This line shows an error - * "Unable to resolve identifier signedLong." in the editor * It compiles correctly however using the c compiler. */ UnionMemberStruct test3 = {34, {.signedLong = (long) - 200000}}; /* * */ int main() { test3.answer = test0.signedLong + test1.unsignedChar + test3.testData.signedLong; while (1); return (EXIT_SUCCESS); } /*-----------------------------------------------------------------------------------------------------------*/ Hope this helps Kind regards Jeff
*** This bug has been marked as a duplicate of bug 255328 ***