Ralph --

What OS / compiler are you using?

I just compiled on MacOS (first time in a while) and filed a PR and a few 
issues about the warnings I found, but I cannot replicate these warnings.  I 
also built with gcc 7.3.0 on RHEL; couldn't replicate the warnings.

On MacOS, I'm using the default Xcode compilers:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin





> On Sep 10, 2018, at 6:57 PM, Ralph H Castain <r...@open-mpi.org> wrote:
> 
> Still seeing this in today’s head of master:
> 
> info_subscriber.c: In function 'opal_infosubscribe_change_info':
> ../../opal/util/info.h:112:31: warning: '%s' directive output may be 
> truncated writing up to 36 bytes into a region of size 27 
> [-Wformat-truncation=]
>  #define OPAL_INFO_SAVE_PREFIX "_OMPI_IN_"
>                                ^
> info_subscriber.c:268:13: note: in expansion of macro 'OPAL_INFO_SAVE_PREFIX'
>              OPAL_INFO_SAVE_PREFIX "%s", key);
>              ^~~~~~~~~~~~~~~~~~~~~
> info_subscriber.c:268:36: note: format string is defined here
>              OPAL_INFO_SAVE_PREFIX "%s", key);
>                                     ^~
> In file included from 
> /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/include-fixed/stdio.h:425:0,
>                  from ../../opal/class/opal_list.h:71,
>                  from ../../opal/util/info_subscriber.h:30,
>                  from info_subscriber.c:45:
> info_subscriber.c:267:9: note: '__builtin_snprintf' output between 10 and 46 
> bytes into a destination of size 36
>          snprintf(modkey, OPAL_MAX_INFO_KEY,
>          ^
> In file included from 
> /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/include-fixed/stdio.h:425:0,
>                  from ../../opal/class/opal_list.h:71,
>                  from ../../opal/util/info.h:30,
>                  from info.c:46:
> info.c: In function 'opal_info_dup_mode.constprop':
> ../../opal/util/info.h:112:31: warning: '%s' directive output may be 
> truncated writing up to 36 bytes into a region of size 28 
> [-Wformat-truncation=]
>  #define OPAL_INFO_SAVE_PREFIX "_OMPI_IN_"
>                                ^
> info.c:212:22: note: in expansion of macro 'OPAL_INFO_SAVE_PREFIX'
>                       OPAL_INFO_SAVE_PREFIX "%s", pkey);
>                       ^~~~~~~~~~~~~~~~~~~~~
> info.c:212:45: note: format string is defined here
>                       OPAL_INFO_SAVE_PREFIX "%s", pkey);
>                                              ^~
> In file included from 
> /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/include-fixed/stdio.h:425:0,
>                  from ../../opal/class/opal_list.h:71,
>                  from ../../opal/util/info.h:30,
>                  from info.c:46:
> info.c:211:18: note: '__builtin_snprintf' output between 10 and 46 bytes into 
> a destination of size 37
>                   snprintf(savedkey, OPAL_MAX_INFO_KEY+1,
>                   ^
> 
> 
> _______________________________________________
> devel mailing list
> devel@lists.open-mpi.org
> https://lists.open-mpi.org/mailman/listinfo/devel


-- 
Jeff Squyres
jsquy...@cisco.com

_______________________________________________
devel mailing list
devel@lists.open-mpi.org
https://lists.open-mpi.org/mailman/listinfo/devel

Reply via email to