www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.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