[antlr-interest] [C target] Warnings in 64-bit compile

Justin Murray jmurray at aerotech.com
Tue Dec 28 11:59:17 PST 2010


Jim,

 

I am working on making our compiler support 64-bit builds, and have run
into a number of compiler warnings due to conflicting types in the ANTLR
generated C code:

 

warning C4244: '=' : conversion from 'ANTLR3_MARKER' to 'ANTLR3_UINT32',
possible loss of data

 

This comes from the line:

 

axisMask_StartIndex = INDEX();

 

axisMask_StartIndex is declared as type ANTLR3_UINT32, and INDEX() is
returning type ANTLR3_MARKER. On a 64-bit build (on a Windows machine),
ANTLR3_UINT32 is a typedef of uint32_t, and ANTLR3_MARKER is of type
ANTLR3_INT64 which is a typedef of int64_t. It seems to me that this is
a bug in the template, and that axisMask_StartIndex should have been
declared as type ANTLR3_MARKER.

 

My questions are, do you know of a quick workaround for this for now? Do
you know if this will be fixed in the next release of the C target
runtime? Also, is there a tenative release date for the C runtime that
will officially support ANTLR 3.3 (it seems that the code generated by
ANTLR 3.3 works ok with the 3.2 C runtime)?

 

Thanks,

Justin Murray 
Software Engineer 
jmurray at aerotech.com

Aerotech, Inc. 
101 Zeta Drive 
Pittsburgh, PA 15238 
412-963-7470

 



More information about the antlr-interest mailing list