[mpich-discuss] GCC 4.8.0 warnings

Jeff Hammond jhammond at alcf.anl.gov
Mon May 13 16:04:14 CDT 2013


The vast majority of these errors are of no concern.  I suggest that
you do not set --enable-strict unless you intend to carefully inspect
the resulting warnings for significance.

If size_t is only typedef'd to 'unsigned int' since this is a 32-bit
system, then the implicit cast to 'long unsigned int' is really not a
big deal.  There is no need for an MPI implementation to print
anything for a correct (i.e. standard-compliant) program so those
printf calls are probably warnings or errors.  I recall that %zu is
C99 so MPICH would need an explicit up-cast to "long unsigned" there
but I fail to see how it matters.

I do not see how any possible harm can come from
"unused-but-set-variable".  The "empty-body" warning is similarly of
no interest.  There is no reason to care about "unused-function".  The
compiler or linker should remove it from the object/binary anyways.

I didn't look at the MPICH source but every time I have seen
"maybe-uninitialized" warnings, it is not actually possible for the
variable to be uninitialized, but rather that the compiler cannot
figure this out for certain (maybe it's equivalent to the halting
problem to do so...).

It is just pedantic to tell the user that a comparison to NULL will
always be true.  The compiler will probably optimize this away anyways
if it is certain about the branch.

The only error that has me even the slightest bit worried is "nonnull"
but my guess is that it really doesn't matter.

If you inspect the source and find that my analysis is misguided and
these warnings correspond to real problems that need addressing, I'm
sure that the MPICH team will welcome your contribution of a patch for
them.

Best,

Jeff

$ grep warning Log
src/mpltrmem.c:352:17: warning: format '%lu' expects argument of type
'long unsigned int', but argument 5 has type 'size_t' [-Wformat=]
src/mpltrmem.c:372:17: warning: format '%lu' expects argument of type
'long unsigned int', but argument 5 has type 'size_t' [-Wformat=]
src/mpltrmem.c:414:9: warning: format '%lu' expects argument of type
'long unsigned int', but argument 4 has type 'size_t' [-Wformat=]
src/mpltrmem.c:531:17: warning: format '%lu' expects argument of type
'long unsigned int', but argument 5 has type 'size_t' [-Wformat=]
src/mpltrmem.c:597:13: warning: format '%lu' expects argument of type
'long unsigned int', but argument 4 has type 'size_t' [-Wformat=]
src/mpltrmem.c:583:14: warning: variable 'old_head' set but not used
[-Wunused-but-set-variable]
mpi-io/mpiu_external32.c:123:14: warning: unused variable 'extent'
[-Wunused-variable]
./pm/pmiserv/pmip_cb.c:811:9: warning: null argument where non-null
required (argument 1) [-Wnonnull]
./pm/pmiserv/pmip_cb.c:811:9: warning: null argument where non-null
required (argument 2) [-Wnonnull]
src/mpi/coll/opminloc.c:85:24: warning: variable 'flen' set but not
used [-Wunused-but-set-variable]
src/mpi/coll/opmaxloc.c:86:24: warning: variable 'flen' set but not
used [-Wunused-but-set-variable]
src/mpid/ch3/src/ch3u_handle_connection.c:316:194: warning: suggest
braces around empty body in an 'if' statement [-Wempty-body]
src/mpid/ch3/src/ch3u_rma_sync.c:2884:12: warning:
'MPIDI_CH3I_Send_flush_msg' defined but not used [-Wunused-function]
./src/include/mpimem.h:267:31: warning: 'mpiu_chkpmem_stk_[0]' may be
used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpimem.h:267:31: warning: 'mpiu_chkpmem_stk_[0]' may be
used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpimem.h:480:32: warning: the comparison will always
evaluate as 'true' for the address of 'MPID_nem_tcp_g_lstn_sc' will
never be NULL [-Waddress]
./src/include/mpimem.h:480:32: warning: the comparison will always
evaluate as 'true' for the address of 'MPID_nem_tcp_g_lstn_plfd' will
never be NULL [-Waddress]
src/mpid/common/datatype/mpid_type_debug.c:238:59: warning: variable
'sticky_ub' set but not used [-Wunused-but-set-variable]
src/mpid/common/datatype/mpid_type_debug.c:238:48: warning: variable
'sticky_lb' set but not used [-Wunused-but-set-variable]
src/mpid/common/datatype/mpid_type_debug.c:238:44: warning: variable
'ub' set but not used [-Wunused-but-set-variable]
src/mpid/common/datatype/mpid_type_debug.c:238:31: warning: variable
'true_ub' set but not used [-Wunused-but-set-variable]
src/mpid/common/datatype/mpid_type_debug.c:236:11: warning: variable
'string' set but not used [-Wunused-but-set-variable]
./src/include/mpir_nbc.h:151:23: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpimem.h:267:31: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpir_nbc.h:151:23: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpir_nbc.h:151:23: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpimem.h:267:31: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpimem.h:267:31: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpir_nbc.h:151:23: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]
./src/include/mpimem.h:267:31: warning: 'mpir_sched_chkpmem_stk_[0]'
may be used uninitialized in this function [-Wmaybe-uninitialized]

On Mon, May 13, 2013 at 2:46 PM, Yauheni Zelenko <zelenko at cadence.com> wrote:
> Hi, Jeff!
>
> See attached file in original e-mail.
>
> Eugene.
> ________________________________________
> From: discuss-bounces at mpich.org [discuss-bounces at mpich.org] On Behalf Of Jeff Hammond [jhammond at alcf.anl.gov]
> Sent: Monday, May 13, 2013 11:59 AM
> To: discuss at mpich.org
> Subject: Re: [mpich-discuss] GCC 4.8.0 warnings
>
> Care to share make.log with the warnings to which you refer?
>
> Jeff
>
> On Mon, May 13, 2013 at 1:51 PM, Yauheni Zelenko <zelenko at cadence.com> wrote:
>> Hi, Antonio!
>>
>> I compiled on RHEL 6.0.
>>
>> My configuration is:
>>
>> ./configure --prefix=${InstallDir}                                              \
>>         --with-pm=hydra --with-device=ch3:nemesis                               \
>>         --disable-chekpointing                                                  \
>>         --enable-strict --enable-fast=O3                                        \
>>         --disable-f77 --disable-fc                                              \
>>         CC=${GCCDir}/bin/gcc CFLAGS="-m32 -fPIC"             \
>>         CPP=${GCCDir}/bin/cpp                                                   \
>>         CXX=${GCCDir}/bin/g++ CXXFLAGS="-m32 -fPIC"          \
>>         CXXCPP=${GCCDir}/bin/cpp                                                \
>>
>> Eugene.
>> ________________________________________
>> From: Antonio J. Peña [apenya at mcs.anl.gov]
>> Sent: Monday, May 13, 2013 11:37 AM
>> To: discuss at mpich.org
>> Cc: Yauheni Zelenko
>> Subject: Re: [mpich-discuss] GCC 4.8.0 warnings
>>
>> Hi Eugene,
>>
>> Could you please provide us with the whole details of your platform? (i.e.,
>> Linux distribution and version, and HW details).
>>
>> Thanks,
>>   Antonio
>>
>>
>> On Monday, May 13, 2013 11:25:38 AM Yauheni Zelenko wrote:
>>> Hi!
>>>
>>> I compiled recent nightly build (3.0.4 as of May 13) with GCC 4.8.0.
>>>
>>> There are some warnings which will be good idea to fix.
>>>
>>> Eugene.
>>
>> _______________________________________________
>> discuss mailing list     discuss at mpich.org
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/discuss
>
>
>
> --
> Jeff Hammond
> Argonne Leadership Computing Facility
> University of Chicago Computation Institute
> jhammond at alcf.anl.gov / (630) 252-5381
> http://www.linkedin.com/in/jeffhammond
> https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
> ALCF docs: http://www.alcf.anl.gov/user-guides
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
ALCF docs: http://www.alcf.anl.gov/user-guides



More information about the discuss mailing list