Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-5864

TArray headers files cast away qualifiers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • None
    • 5.34/00
    • Core Libraries
    • None
    • Any

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

      Attachments

        Activity

          People

            pcanal Philippe Canal
            dgeerts Daniel Geerts (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: