IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 25, 2006, 6:34:28 PM (20 years ago)
Author:
jhoblitt
Message:

add gcc format attributes to:

psAbort()
psErrorStackPrint()
p_psError()
p_psWarning()
psLogMsg()
p_psTrace()

add PS_ASSERT_LONG_LARGER_THAN_OR_EQUAL
add PS_ASSERT_S64_WITHIN_RANGE
fix PS_ASSERT_LONG_WITHIN_RANGE
fix a wide range of format related issues:

  • missing format field specifiers
  • missing format args
  • incorrect format field specifiers
  • constants declared with the wrong type (float vs. int)
  • PS_ASSERT* for the wrong type
  • attemps to print structs with *printf()
  • unportable format specifiers, eg. long vs. long long
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psError.h

    r8231 r8627  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-08-08 23:11:25 $
     14 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-08-26 04:34:28 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9292 *
    9393 */
     94#ifdef __GNUC__
    9495void psErrorStackPrint(
    9596    FILE* fd,                          ///< destination file descriptor
    96     const char* format,                   ///< printf-style format of header line
    97     ...                                ///< any parameters required in fmt
    98 );
     97    const char* format,                ///< printf-style format of header line
     98    ...                                ///< any parameters required in fmt
     99) __attribute__((format(printf, 2, 3)));
     100#else // __GNUC__
     101void psErrorStackPrint(
     102    FILE* fd,                          ///< destination file descriptor
     103    const char* format,                ///< printf-style format of header line
     104    ...                                ///< any parameters required in fmt
     105);
     106#endif // __GNUC__
     107
    99108
    100109#ifndef SWIG
     
    155164 *  @return psErrorcode    the given error code
    156165 */
     166#ifdef __GNUC__
    157167psErrorCode p_psError(
    158168    const char* filename,              ///< file name
     
    163173    const char* format,                ///< printf-style format of header line
    164174    ...                                ///< any parameters required in fmt
    165 );
     175) __attribute__((format(printf, 6, 7)));
     176#else // __GNUC__
     177psErrorCode p_psError(
     178    const char* filename,              ///< file name
     179    unsigned int lineno,               ///< line number in file
     180    const char* func,                  ///< function name
     181    psErrorCode code,                  ///< Error class code
     182    bool new,                          ///< true if error originates at this location
     183    const char* format,                ///< printf-style format of header line
     184    ...                                ///< any parameters required in fmt
     185);
     186#endif // __GNUC__
    166187
    167188/** Logs a warning message.
     
    172193 *
    173194*/
     195#ifdef __GNUC__
    174196void p_psWarning(
    175197    const char* file,                  ///< file name
    176198    int lineno,                        ///< line number in file
    177199    const char* func,                  ///< function name
    178     const char* fmt,                   ///< printf-style format of header line
    179     ...                                ///< any parameters required in fmt
    180 );
     200    const char* format,                ///< printf-style format of header line
     201    ...                                ///< any parameters required in fmt
     202) __attribute__((format(printf, 4, 5)));
     203#else // __GNUC__
     204void p_psWarning(
     205    const char* file,                  ///< file name
     206    int lineno,                        ///< line number in file
     207    const char* func,                  ///< function name
     208    const char* format,                ///< printf-style format of header line
     209    ...                                ///< any parameters required in fmt
     210);
     211#endif // __GNUC__
    181212
    182213
Note: See TracChangeset for help on using the changeset viewer.