[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




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).

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 ]


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


Generated at Mon Feb 24 17:06:49 CET 2020 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.