#3765: Warnings on OS X during make phase.
------------------------+----------------------
 Reporter:  balderdash  |      Owner:  mutt-dev
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  build       |    Version:
 Keywords:              |
------------------------+----------------------
 {{{
 When I build mutt from tip on OS X 10.10.4, I see a lot of warnings
 during the 'make' phase.  I'm not a programmer, so I don't know if
 these are important or not.  But I thought I'd report them here just
 in case they need to be fixed.

 Note that mutt builds fine.  I just get the warnings below (they're
 separated by lots of warning-free steps, so I've only included the
 warning parts plus one leading line of context).

 -------------8<-------------------------------------
 gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../intl -I/usr/local/ssl/include
 -I../intl  -Wall -pedantic -Wno-long-long -g -O2 -MT util.o -MD -MP -MF
 .deps/util.Tpo -c -o util.o util.c
 util.c:594:28: warning: absolute value function 'abs' given an argument of
 type 'time_t' (aka 'long') but has parameter of type 'int'
       which may cause truncation of value [-Wabsolute-value]
       (int) tz / 60, (int) abs (tz) % 60);
                            ^
 /usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
   __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                              ^
 util.c:594:28: note: use function 'labs' instead
       (int) tz / 60, (int) abs (tz) % 60);
                            ^~~
                            labs
 /usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
   __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                              ^
 1 warning generated.

 -------------8<-------------------------------------
 gcc -DPKGDATADIR=\"/usr/local/share/mutt\" -DSYSCONFDIR=\"/usr/local/etc\"
 -DBINDIR=\"/usr/local/bin\" -DMUTTLOCALEDIR=\"/usr/local/share/locale\"
 -DHAVE_CONFIG_H=1 -I.  -I. -I. -I./imap  -Iintl -I/usr/local/ssl/include
 -I./intl  -Wall -pedantic -Wno-long-long -g -O2 -MT help.o -MD -MP -MF
 .deps/help.Tpo -c -o help.o help.c
 help.c:83:35: warning: passing 'const char *const' to parameter of type
 'char *' discards qualifiers
       [-Wincompatible-pointer-types-discards-qualifiers]
     mutt_make_help (pbuf, buflen, _(items[i].name), menu, items[i].value);
                                   ^~~~~~~~~~~~~~~~
 ./lib.h:53:16: note: expanded from macro '_'
 #  define _(a) (a)
                ^~~
 help.c:57:50: note: passing argument to parameter 'txt' here
 void mutt_make_help (char *d, size_t dlen, char *txt, int menu, int op)
                                                  ^
 1 warning generated.

 -------------8<-------------------------------------
 gcc -DPKGDATADIR=\"/usr/local/share/mutt\" -DSYSCONFDIR=\"/usr/local/etc\"
 -DBINDIR=\"/usr/local/bin\" -DMUTTLOCALEDIR=\"/usr/local/share/locale\"
 -DHAVE_CONFIG_H=1 -I.  -I. -I. -I./imap  -Iintl -I/usr/local/ssl/include
 -I./intl  -Wall -pedantic -Wno-long-long -g -O2 -MT sendlib.o -MD -MP -MF
 .deps/sendlib.Tpo -c -o sendlib.o sendlib.c
 sendlib.c:1489:27: warning: absolute value function 'abs' given an
 argument of type 'time_t' (aka 'long') but has parameter of type
       'int' which may cause truncation of value [-Wabsolute-value]
             (int) tz / 60, (int) abs (tz) % 60);
                                  ^
 /usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
   __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                              ^
 sendlib.c:1489:27: note: use function 'labs' instead
             (int) tz / 60, (int) abs (tz) % 60);
                                  ^~~
                                  labs
 /usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
   __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                              ^
 1 warning generated.

 -------------8<-------------------------------------
 gcc -DPKGDATADIR=\"/usr/local/share/mutt\" -DSYSCONFDIR=\"/usr/local/etc\"
 -DBINDIR=\"/usr/local/bin\" -DMUTTLOCALEDIR=\"/usr/local/share/locale\"
 -DHAVE_CONFIG_H=1 -I.  -I. -I. -I./imap  -Iintl -I/usr/local/ssl/include
 -I./intl  -Wall -pedantic -Wno-long-long -g -O2 -MT hcache.o -MD -MP -MF
 .deps/hcache.Tpo -c -o hcache.o hcache.c
 hcache.c:556:2: warning: embedding a directive within macro arguments has
 undefined behavior [-Wembedded-directive]
 #ifndef HAVE_ICONV
  ^
 hcache.c:564:2: warning: embedding a directive within macro arguments has
 undefined behavior [-Wembedded-directive]
 #ifndef HAVE_ICONV
  ^
 2 warnings generated.
 -------------8<-------------------------------------

 }}}

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3765>
Mutt <http://www.mutt.org/>
The Mutt mail user agent

Reply via email to