New compiler warnings

Dear Rooters

Yesterday I have downloaded the new CVS version, and now I am
trying to recompile all my libraries. For some reason I get
the following new compiler warnings:

c++ -O -pipe -Wall -D_REENTRANT -I/sw/include -I/Users/cs/ROOT/root/include -c XPSUtils.cxx
In file included from /Users/cs/ROOT/root/include/TSystem.h:30,
from XPSUtils.cxx:38:
/Users/cs/ROOT/root/include/G__ci.h:913: warning: use of long double' type; its size may change in a future release /Users/cs/ROOT/root/include/G__ci.h:913: warning: (Long double usage is reported only once for each file. /Users/cs/ROOT/root/include/G__ci.h:913: warning: To disable this warning, use -Wno-long-double.) Generating dictionary XPSUtilsDict.cxx... c++ -O -pipe -Wall -D_REENTRANT -I/sw/include -I/Users/cs/ROOT/root/include -c XPSUtilsDict.cxx In file included from XPSUtilsDict.h:17, from XPSUtilsDict.cxx:16: /Users/cs/ROOT/root/include/G__ci.h:913: warning: use oflong double’
type; its size may change in a future release
/Users/cs/ROOT/root/include/G__ci.h:913: warning: (Long double usage is
reported only once for each file.
/Users/cs/ROOT/root/include/G__ci.h:913: warning: To disable this
warning, use -Wno-long-double.)
c++ -dynamiclib -flat_namespace -undefined suppress XPSUtils.o XPSUtilsDict.o -o libXPSUtils.dylib
c++ -bundle -undefined suppress -Wl,-x -O -Xlinker -bind_at_load -flat_namespace XPSUtils.o XPSUtilsDict.o
-o libXPSUtils.so

Do you know what this means and whether I need to adopt my code?

Best regards
Christian

Hi Christian,

For some reason you are not using the standard compile
flags . Do/Did you

  • have a MyConfig.mk in your source directory that overrules
    the standard flag .
  • change the config/Makefile.macosx

One of the standard flags that removes the warning is “-Wno-long-double”

Eddy

Dear Eddy

Thank you for your answer.
I do not mean root which compiled fine.
However, when compiling my own libraries with my own makefiles (which
do not contain the -Wno-long-double flag) I get now these warnings.

If necessary, I will add the new flag to my makefiles, but I am wondering:
Until root version 4.03/02 I did not get these warnings. So my question is:
Has something important changed in the new version 4.03/05 which causes
these warnings?

Best regards
Christian

Christian,

To avoid this kind of problem, always use the same compiler options
as ROOT itself.
To see these options run
root-config --cflags
or better compile with
g++ -c myfile.cxx root-config --cflags

Rene

Hi Christian,

I’ve added -Wno-long-double to the cflags option generated by
root-config --cflags because the recent versions of cint include support for long-doubles which causes this warning also in user code.

If you don’t use the head add this -Wno-long-double to your own makefile.

Cheers, Fons.

Dear Rene

Thank you, but I am afraid that this does not solve the problem.
As you can see from the attached makefile, I am already using these
options, nevertheless I have to add the new option -Wno-long-doubl
manually to CXXFLAGS in order to get rid of the new warnings.
But maybe there is a mistake in my makefile?

Best regards
Christian

Dear Fons

While trying to send the missing attachment, I have seen your mail, thank you.

Nevertheless, I add as attachment one of my makefiles.

Best regards
Christian

P.S.: For some reason it is not possible to add my makefile “Makefile4XPSSchemes” as attachment,
I am always getting the message:
“The Extension array is not allowed”

So I enclose it as code:

# Makefile for XPSSchemes.
# shell: gmake -f Makefile4XPSSchemes 
# maxosx: make -f Makefile4XPSSchemes 
# note: command-lines have to start with Tab (see book KDE1.1 p.193)
#
# Copyright (c) 2000 Rene Brun and Fons Rademakers
#
# Author: Christian Stratowa, 19 May 2002

ARCH          = $(shell root-config --arch)

CXX           =
ObjSuf        = o
SrcSuf        = cxx
ExeSuf        =
DllSuf        = so
OutPutOpt     = -o 

ROOTCFLAGS   := $(shell root-config --cflags)
ROOTLIBS     := $(shell root-config --libs)
ROOTGLIBS    := $(shell root-config --glibs)


ifeq ($(ARCH),linuxegcs)
# Linux with egcs (>= RedHat 5.2)
CXX           = g++
CXXFLAGS      = -O -Wall -fPIC
LD            = g++
LDFLAGS       = -O
SOFLAGS       = -shared
endif

ifeq ($(ARCH),linuxppcegcs)
# MkLinux with egcs/glibc
CXX           = g++
#CXXFLAGS      = -O -Wall -fPIC
CXXFLAGS      = -O -Wall -fPIC -Wno-long-double
LD            = g++
LDFLAGS       = -O
SOFLAGS       = -shared
#SOFLAGS       = -shared -Wl,-soname,
endif

ifeq ($(ARCH),macosx)
# MacOS X with cc (GNU cc 2.95.2)
CXX           = c++
#CXXFLAGS      = -O -Wall -fPIC
CXXFLAGS      = -O -Wall -fPIC -Wno-long-double
LD            = c++
LDFLAGS       = -O -Xlinker -bind_at_load -flat_namespace
# The SOFLAGS will be used to create the .dylib; the .so will
# be created separately
DllSuf        = dylib
SOFLAGS       = -dynamiclib -flat_namespace -undefined suppress
endif


CXXFLAGS     += $(ROOTCFLAGS)
LIBS          = $(ROOTLIBS) $(SYSLIBS)
GLIBS         = $(ROOTGLIBS) $(SYSLIBS)

#------------------------------------------------------------------------------

XPSSCHEMESO       = XPSSchemes.$(ObjSuf) XPSSchemesDict.$(ObjSuf)
XPSSCHEMESS       = XPSSchemes.$(SrcSuf) XPSSchemesDict.$(SrcSuf)
XPSSCHEMESSO      = libXPSSchemes.$(DllSuf)


OBJS          = $(XPSSCHEMESO)
PROGRAMS      = $(XPSSCHEMESSO)

#------------------------------------------------------------------------------

.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)

all:            $(PROGRAMS)

$(XPSSCHEMESSO):    $(XPSSCHEMESO)
ifeq ($(ARCH),macosx)
# We need to make both the .dylib and the .so
		$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
		$(LD) -bundle -undefined suppress -Wl,-x $(LDFLAGS) $^ \
		   $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
else
	        $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@
endif

clean:
		@rm -f $(OBJS) core

.SUFFIXES: .$(SrcSuf)

###


XPSSchemes.$(ObjSuf): XPSSchemes.h
XPSSchemesDict.$(SrcSuf): XPSSchemes.h XPSSchemesLinkDef.h
	@echo "Generating dictionary $@..."
	@rootcint -f $@ -c $^

.$(SrcSuf).$(ObjSuf):
	$(CXX) $(CXXFLAGS) -c $<