Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] Compiler warnings
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2012-07-12 08:10:11


This is the gcc that comes with RHEL 6.x:

% gcc --version
gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

On Jul 12, 2012, at 8:01 AM, Brice Goglin wrote:

> Le 12/07/2012 13:35, Jeff Squyres a écrit :
>> I silenced some harmless compiler warnings (i.e., the compiler couldn't tell that some variables would always be initialized) in r4610.
>>
>> I'm getting a few others, though -- could you have a look?
>>
>> distances.c: In function 'hwloc_distances_set_from_env':
>> distances.c:259: warning: '__old_locale' may be used uninitialized in this function
>> topology-xml.c: In function 'hwloc_topology_export_xmlbuffer':
>> topology-xml.c:882: warning: '__old_locale' may be used uninitialized in this function
>> topology-xml.c: In function 'hwloc_topology_export_xml':
>> topology-xml.c:857: warning: '__old_locale' may be used uninitialized in this function
>>
>
> I saw some similar new compiler warnings with gcc 4.7.x (and I already
> fixed them) but I can't get yours with 4.7.1 now. Which compiler do you
> have?
>
> The patch should fix them but the compiler shouldn't be that dumb.
>
> Brice
>
> --- include/private/private.h (révision 4610)
> +++ include/private/private.h (copie de travail)
> @@ -346,7 +346,7 @@
> #ifdef HAVE_XLOCALE_H
> #include "xlocale.h"
> #endif
> -#define hwloc_localeswitch_declare locale_t __old_locale, __new_locale
> +#define hwloc_localeswitch_declare locale_t __old_locale = (locale_t)0, __new_locale
> #define hwloc_localeswitch_init() do { \
> __new_locale = newlocale(LC_ALL_MASK, "C", (locale_t)0); \
> if (__new_locale != (locale_t)0) \
>
>
> _______________________________________________
> hwloc-devel mailing list
> hwloc-devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-devel

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/