Bug 1859

Summary: clang unused variable
Product: ns-3 Reporter: Sascha Jopen <jopen>
Component: mpiAssignee: Brian Swenson <bswenson3>
Status: RESOLVED FIXED    
Severity: normal CC: joshpelkey, ns-bugs, smith84, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: PC   
OS: Linux   

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