www.digitalmars.com         C & C++   DMDScript  

c++ - Missing init sequence in cpp

Hi Walter,

I have reduced a problem while porting from C to C++ to the following simple
case:

test.c
----------------------
const char test[]={
 "Rajiv"
 };
----------------------
Using 8.41, when I use "dmc -c test.c", resulting OBJ is fine. Just rename
'test.c' to 'test.cpp', the letters "Rajiv" go missing from the obj file.
Remove 'const' and they appear in the obj.

This is independent of the memory model.
Using 'char const test[]" also produces similar bad results for the cpp. The
file contains no executable code. (Actually, the array is inited with a
fixed large binary object expressed as series of integers, all of which go
missing from the obj for cpp extension.)

Thanks,
- Rajiv
Feb 14 2005