bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gprofng/32097] New: Warnings when building gprofng with Clang


From: sam at gentoo dot org
Subject: [Bug gprofng/32097] New: Warnings when building gprofng with Clang
Date: Sun, 18 Aug 2024 09:16:16 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=32097

            Bug ID: 32097
           Summary: Warnings when building gprofng with Clang
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gprofng
          Assignee: vladimir.mezentsev at oracle dot com
          Reporter: sam at gentoo dot org
  Target Milestone: ---

I see a few suspicious warnings when building gprofng with clang.

```
In file included from /tmp/binutils-gdb/gprofng/src/Dbe.cc:31:
In file included from /tmp/binutils-gdb/gprofng/src/DbeSession.h:46:
In file included from /tmp/binutils-gdb/gprofng/src/Hist_data.h:31:
/tmp/binutils-gdb/gprofng/src/HashMap.h:83:5: warning: explicitly assigning
value of variable of type 'uint64_t' (aka 'unsigned long') to itself
[-Wself-assign]
   83 |   a = a;
      |   ~ ^ ~
/tmp/binutils-gdb/gprofng/src/Dbe.cc:9596:13: warning: explicitly assigning
value of variable of type 'Sample *' to itself [-Wself-assign]
 9596 |             sample = sample;
      |             ~~~~~~ ^ ~~~~~~
2 warnings generated.

[...]

In file included from /tmp/binutils-gdb/gprofng/src/gp-display-text.cc:25:
In file included from /tmp/binutils-gdb/gprofng/src/gp-print.h:24:
In file included from /tmp/binutils-gdb/gprofng/src/Command.h:29:
In file included from /tmp/binutils-gdb/gprofng/src/Hist_data.h:31:
/tmp/binutils-gdb/gprofng/src/HashMap.h:83:5: warning: explicitly assigning
value of variable of type 'uint64_t' (aka 'unsigned long') to itself
[-Wself-assign]
   83 |   a = a;
      |   ~ ^ ~
In file included from /tmp/binutils-gdb/gprofng/src/gp-display-text.cc:25:
/tmp/binutils-gdb/gprofng/src/gp-print.h:21:9: warning: '_GP_PRINT_H' is used
as a header guard here, followed by #define of a different macro
[-Wheader-guard]
   21 | #ifndef _GP_PRINT_H
      |         ^~~~~~~~~~~
/tmp/binutils-gdb/gprofng/src/gp-print.h:22:9: note: '_ER_PRINT_H' is defined
here; did you mean '_GP_PRINT_H'?
   22 | #define _ER_PRINT_H
      |         ^~~~~~~~~~~
      |         _GP_PRINT_H

[...]

In file included from /tmp/binutils-gdb/gprofng/src/Experiment.cc:44:
In file included from /tmp/binutils-gdb/gprofng/src/DbeSession.h:46:
In file included from /tmp/binutils-gdb/gprofng/src/Hist_data.h:31:
/tmp/binutils-gdb/gprofng/src/HashMap.h:83:5: warning: explicitly assigning
value of variable of type 'uint64_t' (aka 'unsigned long') to itself
[-Wself-assign]
   83 |   a = a;
      |   ~ ^ ~

[...]

/tmp/binutils-gdb/gprofng/src/collctrl.cc:876:7: warning: explicitly assigning
value of variable of type 'double' to itself [-Wself-assign]
  876 |         dval = dval;
      |         ~~~~ ^ ~~~~

[...]

In file included from /tmp/binutils-gdb/gprofng/src/dbe_hwctable.c:23:
In file included from /tmp/binutils-gdb/gprofng/src/../common/hwctable.c:1307:
/tmp/binutils-gdb/gprofng/src/hwc_intel_icelake.h:36:55: warning: initializer
overrides prior initialization of this subobject [-Winitializer-overrides]
   36 |   { I("l1d.replacement", 0x51, 0x1, 0, 0, 0, 0, 0, 0, 0x186a3,
      |                                                       ^~~~~~~
/tmp/binutils-gdb/gprofng/src/hwc_intel_icelake.h:30:11: note: expanded from
macro 'I'
   30 |           .val = period
      |                  ^~~~~~
/tmp/binutils-gdb/gprofng/src/hwc_intel_icelake.h:36:5: note: previous
initialization is here
   36 |   { I("l1d.replacement", 0x51, 0x1, 0, 0, 0, 0, 0, 0, 0x186a3,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |     STXT("Counts the number of cache lines replaced in L1 data cache"))
},
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/binutils-gdb/gprofng/src/hwc_intel_icelake.h:27:4: note: expanded from
macro 'I'
   27 |           INIT_HWC(nm, mtr, SH(event, 0) | SH(umask, 8) | SH(edge, 18)
\
      |          
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   28 |                      | SH(cmask, 24) | SH(inv, 23), PERF_TYPE_RAW), \
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/binutils-gdb/gprofng/src/../common/hwctable.c:1221:12: note: expanded from
macro 'INIT_HWC'
 1221 |     .val = PRELOAD_DEF, .reg_num = REGNO_ANY
      |            ^~~~~~~~~~~
/tmp/binutils-gdb/gprofng/src/../common/hwctable.c:96:21: note: expanded from
macro 'PRELOAD_DEF'
   96 | #define PRELOAD_DEF PRELOAD(1000,3)  // default interval targets 1000
cycles/event at 3ghz
      |                     ^~~~~~~~~~~~~~~
/tmp/binutils-gdb/gprofng/src/../common/hwctable.c:88:43: note: expanded from
macro 'PRELOAD'
   88 | #define PRELOAD(min_cycles_per_event,ghz)
(((ghz)*CYC_PER_SAMPLE/(min_cycles_per_event))/100*100+1)
      |                                          
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

There's also some -Wunused-but-set-variable and -Wunused-private-field.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]