Changeset e1868fb


Ignore:
Timestamp:
12/31/06 17:41:10 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
4746c71
Parents:
e2d49d5
Message:

Add attribute((format(printf))) flags to functions that should have it.
Found a nasty bug in trace_get_server_port() where the body of an if() wasn't
correctly {}'d.

Location:
lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    r4bd8a5b re1868fb  
    140140#  define UNUSED __attribute__((unused))
    141141#  define PACKED __attribute__((packed))
     142#  define PRINTF(formatpos,argpos) __attribute__((format(printf,formatpos,argpos)))
    142143#else
    143144#  define SIMPLE_FUNCTION
    144145#  define UNUSED
    145146#  define PACKED
     147#  define PRINTF(formatpos,argpos)
    146148#endif
    147149       
     
    787789 * This function does clear the error status.
    788790 */
    789 DLLEXPORT void trace_perror(libtrace_t *trace, const char *msg,...);
     791DLLEXPORT void trace_perror(libtrace_t *trace, const char *msg,...) PRINTF(2,3);
    790792
    791793/** Check (and clear) the current error state of an output trace
     
    808810 * This function does clear the error status.
    809811 */
    810 DLLEXPORT void trace_perror_output(libtrace_out_t *trace, const char *msg,...);
     812DLLEXPORT void trace_perror_output(libtrace_out_t *trace, const char *msg,...)
     813        PRINTF(2,3);
    811814
    812815
  • lib/libtrace_int.h

    r4bd8a5b re1868fb  
    150150};
    151151
    152 void trace_set_err(libtrace_t *trace, int errcode,const char *msg,...);
    153 void trace_set_err_out(libtrace_out_t *trace, int errcode, const char *msg,...);
     152void trace_set_err(libtrace_t *trace, int errcode,const char *msg,...)
     153                                                                PRINTF(3,4);
     154void trace_set_err_out(libtrace_out_t *trace, int errcode, const char *msg,...)
     155                                                                PRINTF(3,4);
    154156
    155157typedef struct libtrace_sll_header_t {
  • lib/trace.c

    r4bd8a5b re1868fb  
    241241 * and then prints out the help() function registered with each input module
    242242 */
    243 DLLEXPORT void trace_help() {
     243DLLEXPORT void trace_help(void) {
    244244        struct libtrace_format_t *tmp;
    245245        trace_init();
     
    11711171
    11721172        /* dynamic range */
    1173         if (DYNAMIC(source) && DYNAMIC(dest))
     1173        if (DYNAMIC(source) && DYNAMIC(dest)) {
    11741174                if (source < dest)
    11751175                        return USE_SOURCE;
    11761176                return USE_DEST;
     1177        }
    11771178        if (DYNAMIC(source) && !DYNAMIC(dest))
    11781179                return USE_DEST;
Note: See TracChangeset for help on using the changeset viewer.