Bugs item #3544467, was opened at 2012-07-15 17:08
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=742140&aid=3544467&group_id=138953

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: CIL core (parser, visitor, etc)
Group: Bug
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Cody Schuffelen ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Disparity between CIL and GCC in struct/union merging

Initial Comment:
In the attached two files (file1.c and file2.c, combined into one file), 
"struct myStruct" is defined two different ways, each holding a slightly 
different anonymous union:
//file1.c
        union {
                long long int i;
                int* p;
                char c;
        };
//file2.c
        union {
                long long int i;
                double f;
        };

Using gcc and ar, I can compile these two files together into a single object 
file without errors.
gcc -c file1.c
gcc -c file2.c
ar cruv out.a file1.o file2.o
However, using cilly and attempting to merge these two with the following 
commands:
cilly --merge -c file1.c
cilly --merge -c file2.c
cilly --merge --mode=AR cruv out.a file1.o file2.o
I get the following error from CIL:

:-1: Error: Incompatible declaration for build (from file2.o(1)).
 Previous was at file1.c:13 (from file1.o (0)) 
        Failed assumption that struct myStruct and struct myStruct are 
isomorphic (different number of fields in __anonunion____missing_field_name_24 
and __anonunion____missing_field_name_24: 3 != 2.)
struct myStruct {
   int a ;
   union __anonunion____missing_field_name_24 __annonCompField1 ;
};

struct myStruct {
   int a ;
   union __anonunion____missing_field_name_24 __annonCompField1 ;
};
 
Final merging phase (0): file1.o
Final merging phase (1): file2.o
file2.c:12: Warning: The name build is used for two distinct globals
Error: There were errors during merging

This is a trivial example of the error I'm getting in a larger project that I 
am trying to merge together. I am using CIL 1.5.1, downloaded earlier today 
from SourceForge.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=742140&aid=3544467&group_id=138953

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to