Bug 3014 - suppress unused private variable warning
suppress unused private variable warning
Status: RESOLVED WONTFIX
Product: ns-3
Classification: Unclassified
Component: wifi
unspecified
PC Linux
: P5 enhancement
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-15 14:56 EST by Tom Henderson
Modified: 2020-04-12 08:05 EDT (History)
1 user (show)

See Also:


Attachments
proposed patch (878 bytes, patch)
2018-11-15 14:56 EST, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2018-11-15 14:56:47 EST
Created attachment 3216 [details]
proposed patch

As reported on the users list, clang-8.0.0 reports an unused private variable warning despite inclusion of the variable in an attribute binding.

    In file included from ../src/wifi/model/he-configuration.cc:23:
    ../src/wifi/model/he-configuration.h:53:11: error: private field 'm_bssColor' is not used [-Werror,-Wunused-private-field]
      uint8_t m_bssColor;   //!< BSS color

Attached patch is proposal to suppress this warning by defining a destructor and using NS_UNUSED macro on the variable.
Comment 1 sebastien.deronne 2018-11-17 14:02:22 EST
I do not really understand why this pops up, we are actually using this field to be transported in HeOperation IEs.
Comment 2 Tom Henderson 2018-11-18 20:04:49 EST
(In reply to sebastien.deronne from comment #1)
> I do not really understand why this pops up, we are actually using this
> field to be transported in HeOperation IEs.

To clarify, it is Apple LLVM version 8.0.0 (clang-800.0.42.1), not clang-8 (which is still under development.  That compiler seems to be about 2 years old.

Others seem to have encountered similar problems with this compiler:
http://lists.llvm.org/pipermail/llvm-bugs/2013-September/030233.html

So I guess the question is whether we try to support that compiler by adding some NS_UNUSED for private variables referenced only by attributes.