root icon indicating copy to clipboard operation
root copied to clipboard

Revert "[cmake] Silence Clang8 shadow warnings::"

Open guitargeek opened this issue 1 year ago • 4 comments

This reverts commit 66659309b055da2443b1faadd8e2da772cb4b755.

Closes: https://its.cern.ch/jira/browse/ROOT-9763

guitargeek avatar Apr 29 '24 16:04 guitargeek

The warnings are still there:

In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:19:
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TProtoClass.h:50:10: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
   50 |          kIsPointer   = BIT(2),    // data member is a pointer
      |          ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDictionary.h:78:4: note: previous declaration is here
   78 |    kIsPointer       = 0x00001000,
      |    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
In file included from /home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:18:
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TVirtualStreamerInfo.h:77:7: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
   77 |       kIsCompiled            = BIT(16),
      |       ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDictionary.h:86:4: note: previous declaration is here
   86 |    kIsCompiled      = kIsCCompiled,
      |    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
In file included from /home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:18:
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TVirtualStreamerInfo.h:91:59: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
   91 |       kBase        =  0,  kOffsetL = 20,  kOffsetP = 40,  kCounter =  6,  kCharStar = 7,
      |                                                           ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDataType.h:34:4: note: previous declaration is here
   34 |    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
      |    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
In file included from /home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:18:
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TVirtualStreamerInfo.h:91:75: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
   91 |       kBase        =  0,  kOffsetL = 20,  kOffsetP = 40,  kCounter =  6,  kCharStar = 7,
      |                                                                           ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDataType.h:34:20: note: previous declaration is here
   34 |    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
      |                    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
In file included from /home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:18:
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TVirtualStreamerInfo.h:94:75: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
   94 |       kUChar       = 11,  kUShort  = 12,  kUInt    = 13,  kULong   = 14,  kBits     = 15,
      |                                                                           ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDataType.h:34:36: note: previous declaration is here
   34 |    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
      |                                    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
/home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:161:59: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
  161 |       kBase        =  0,  kOffsetL = 20,  kOffsetP = 40,  kCounter =  6,  kCharStar = 7,
      |                                                           ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDataType.h:34:4: note: previous declaration is here
   34 |    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
      |    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
/home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:161:75: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
  161 |       kBase        =  0,  kOffsetL = 20,  kOffsetP = 40,  kCounter =  6,  kCharStar = 7,
      |                                                                           ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDataType.h:34:20: note: previous declaration is here
   34 |    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
      |                    ^
In file included from /home/rembserj/spaces/master/root/src/root/io/rootpcm/src/rootclingIO.cxx:22:
/home/rembserj/spaces/master/root/src/root/io/io/inc/TStreamerInfo.h:165:75: error: declaration shadows a variable in the global namespace [-Werror,-Wshadow]
  165 |       kUChar       = 11,  kUShort  = 12,  kUInt    = 13,  kULong   = 14,  kBits     = 15,
      |                                                                           ^
/home/rembserj/spaces/master/root/src/root/core/meta/inc/TDataType.h:34:36: note: previous declaration is here
   34 |    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
      |                                    ^

But they are not really overwhelming, i.e. the output is not flooded by them.

Maybe, since we're not testing clang on the CI anyway, we should make the -Wshadow flag consistent with gcc and just produce these warnings? That would significantly increase the likelihood that they get fixed, comparing to just having an old Jira issue.

guitargeek avatar Apr 29 '24 16:04 guitargeek

Test Results

    11 files      11 suites   2d 6h 48m 45s :stopwatch:  2 631 tests  2 631 :white_check_mark: 0 :zzz: 0 :x: 27 316 runs  27 316 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 8349b94d.

github-actions[bot] avatar Apr 29 '24 17:04 github-actions[bot]

I am in favour of activating the warnings, both for gcc and clang. However, before doing so, wouldn't it be better to make sure we fix all the present ones?

dpiparo avatar Apr 29 '24 20:04 dpiparo

What I wondered reading the JIRA ticket is if there is a "good" way to fix the warning (compatibility etc.)...

hahnjo avatar Apr 30 '24 13:04 hahnjo

Warnings can't be deactivated since they would still happen

guitargeek avatar Aug 31 '24 15:08 guitargeek