Re: warning with gcc 4.1.1

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Wed, 02 Aug 2006 18:32:29 +0200


Hi COnstantin,

   ok, I see. I will fix it.

Cheers, Fons.

Constantin Loizides wrote:

> Hi Fons,
> 
> I think Boris is not talking about compiline ROOT and getting these 
> warnings
> but rather some other code which includes Bytes.h. I have the same problem
> and temporarily "solved" it by using -Wno-strict-aliasing. In my case I 
> suspect
> that --ansi is originally responsible for these warnings which is not used
> in the ROOT build.
> 
> I did not look much into the Bytes.h source code, but I assume one could 
> fix
> the casts such that the compiler (also with --ansi) does not complain.
> 
> Regards,
> Constantin
> 
> Fons Rademakers wrote:

>> Hi Boris,
>>
>> I've verified on my FC5 x86 and there are no such warning using
>> 4.1.1. Can you double check that your /usr/local/root/include/Bytes.h
>> is the one of 5.12.00. Compare to
>> http://root.cern.ch/lxr/source/base/inc/Bytes.h.
>>
>> Cheers, Fons.
>>
>>
>> Boris Skorodumov wrote:
>>
>>> I found this message
>>> http://root.cern.ch/phpBB2/viewtopic.php?t=3533&start=0&postdays=0&postorder=asc&highlight=&sid=54d044689523a6fd4aaef6b487904293
>>>
>>>
>>> It is still present in v5.13.01 with gcc 4.1.1 (FC5)
>>> This is just all output i got:
>>>
>>> g++ -g -O3 -Wall -fPIC -Wno-deprecated -pthread
>>> -I/usr/local/root/include -c lab2cms.cpp
>>> /usr/local/root/include/Bytes.h: In function 'void tobuf(char*&,
>>> Float_t)':
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h: In function 'void tobuf(char*&,
>>> Double_t)':
>>> /usr/local/root/include/Bytes.h:244: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h: In function 'Float_t
>>> host2net(Float_t)':
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h: In function 'Double_t
>>> host2net(Double_t)':
>>> /usr/local/root/include/Bytes.h:527: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> lab2cms.cpp: In function 'void plotGraph(std::string)':
>>> lab2cms.cpp:792: warning: unused variable 'gr1'
>>> g++ -g -O3 -Wall -fPIC -Wno-deprecated -pthread
>>> -I/usr/local/root/include -c main.cpp
>>> /usr/local/root/include/Bytes.h: In function 'void tobuf(char*&,
>>> Float_t)':
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:222: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h: In function 'void tobuf(char*&,
>>> Double_t)':
>>> /usr/local/root/include/Bytes.h:244: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h: In function 'Float_t
>>> host2net(Float_t)':
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h:510: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> /usr/local/root/include/Bytes.h: In function 'Double_t
>>> host2net(Double_t)':
>>> /usr/local/root/include/Bytes.h:527: warning: dereferencing
>>> type-punned pointer
>>> will break strict-aliasing rules
>>> g++ -g -O3 lab2cms.o main.o -L/usr/local/root/lib -lCore -lCint
>>> -lHist -lGraf
>>> -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics
>>> -pthread -lm -ldl
>>> -rdynamic -o lab2cms
>>>
>>>
>>> --
>>> Boris Skorodumov, PhD Student
>>> Physics Department
>>> University of Notre Dame
>>> In 46556, USA
>>> http://www.nd.edu/~bskorodo
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>

>
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Wed Aug 02 2006 - 18:33:30 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET