Bug 1859 - clang unused variable
clang unused variable
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: mpi
ns-3-dev
PC Linux
: P5 normal
Assigned To: Brian Swenson
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-17 02:53 UTC by Sascha Jopen
Modified: 2014-02-25 12:27 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Jopen 2014-02-17 02:53:24 UTC
Hi,

there is a variable NULL_MESSAGE_MAX_MPI_MSG_SIZE declared and defined in null-message-mpi-interface.cc line 52. However, this variable only used in the code, when NS3_MPI is defined. clang complains about the unused variable resulting in a compile time error. Therefore, this variable should be a preprocessor definition or a public member variable of class NullMessageMpiInterface, for example.

Regards,
Sascha
Comment 1 Brian Swenson 2014-02-24 18:41:03 UTC
I couldn't replicate this on a Ubuntu box with clang 3.2, a Mac with clang 3.3, or an updated Ubuntu box with repo version of clang 3.4.  I was however able to replicate on a Fedora VM with release_34 compiled from source.

Since the NS3_MPI test is used frequently in that code, that's probably the best option.  I'll create a patch.
Comment 2 Brian Swenson 2014-02-25 12:27:30 UTC
10632:e5e6f104f627