IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2018, 8:58:31 PM (8 years ago)
Author:
eugene
Message:

add snprintf_nowarn function to avoid compiler warnings from desired snprint truncations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana.h

    r40291 r40549  
    7979  struct timeval startTimer, stopTimer; \
    8080  gettimeofday (&startTimer, (void *) NULL);
     81
     82// several snprintf statements below my truncate their output
     83// gcc (since 8.1) warns if the output may be truncated.
     84// If we do not care, the following snprintf_nowarn can
     85// replace these snprintf calls. (myNOOP in string.c)
     86
     87# define snprintf_nowarn(...) (snprintf(__VA_ARGS__) < 0 ? myNOOP() : 0)
    8188
    8289#ifdef __GNUC__
     
    314321char   *getword                PROTO((char *string));
    315322char   *skipword               PROTO((char *string));
     323void    myNOOP                 PROTO((void));
    316324
    317325/* in findexec.c */
Note: See TracChangeset for help on using the changeset viewer.