[ROOT-5864] TArray headers files cast away qualifiers Created: 19/Dec/13  Updated: 17/Apr/14  Resolved: 17/Apr/14

Status: Closed
Project: ROOT
Component/s: Core Libraries
Affects Version/s: 5.34/00
Fix Version/s: None

Type: Bug Priority: High
Reporter: Daniel Geerts Assignee: Philippe Canal
Resolution: Fixed Votes: 0
Labels: None
Environment:

Any


Development:

 Description   

I'm testing my code on SLC6, and I'm getting a lot of warnings:

/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/5.34.14-x86_64-slc6-gcc4.7/include/TArrayF.h: In function 'TBuffer& operator<<(TBuffer&, const TArrayF*)':
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/5.34.14-x86_64-slc6-gcc4.7/include/TArrayF.h:77:27: warning: cast from type 'const TArrayF*' to type 'TArray*' casts away qualifiers [-Wcast-qual]

This is because there's a cast on that line that casts a const TArrayF* to a TArray*, casting away the const-ness. The same happens in TArrayD, TArrayS, TArrayI, TArrayC (and probably some other TArray's that I'm not using). The casted-to type should include the const-ness (or if it's supposed to be non-const, the const-ness in the function definition should be removed).



 Comments   
Comment by Daniel Geerts [ 17/Apr/14 ]

Can this (simple) problem please be fixed in the next release? My compiler output is many many times larger due to this.

Comment by Philippe Canal [ 17/Apr/14 ]

Hi,

The problem had already been resolved in v6 and is now also resolved in v5.34/19.

Cheers,
Philippe

Generated at Sun Sep 22 01:38:22 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.