On Fri, 06 Mar 2009, Szak�ts Viktor wrote: > > BTW you can force C++ like initialization by static variable assignment by: > >> set HB_USER_CFLAGS=-DHB_STATIC_STARTUP > >> I left the massage about potential problems caused by pure C > >> initialization > >> also in C++ mode in hbinit.h code on: > >> Sat 07 Maj 2005 02:46:38 CEST > >> so it's nearly 4 years but I do not know if 3-rd part developers ever > >> tried to update their code. Maybe it's time to fully disable this hack? > >> If 4 years is not enough then next 10 also won't help. > Tried with this: > --- > set HB_COMPILER=msvc > set HB_USER_CFLAGS=-GL -DHB_STATIC_STARTUP > set HB_USER_LDFLAGS=/LTCG > set HB_USER_AFLAGS=/LTCG > call make_gnu.bat clean install > out.txt 2>&1 > --- > and got this: > ../../pplib3.c(68) : error C2099: initializer is not a constant > What am I missing?
C standard does not allow such initialization. It can be used only in C++ mode and with some C compilers which enable silently some C++ extensions. BTW The only one reason why we use C++ mode for OpenWatcom builds is missing startup initialization in pure C mode. At least I do not know how to reach such functionality with this compiler in C. In the past I was thinking about disabling startup initialization at all but it has to intorduce some incompatibilities to current and Clipper behavior so I dropped it. We can return to this idea when we will have not other choice in some Harbour ports. best regards, Przemek ps. I'll disable HB_MSC_STARTUP for MSVC C++ mode in a while. _______________________________________________ Harbour mailing list [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
