forked from osmocom/wireshark
aba53424dd
column-utils.h, and add it to expert.h, so we check the arguments to "expert_add_info_format()", at least if the format argument is a constant string. Fix some more calls to "expert_add_info_format()" to pass it a format string. Don't record BoundsError exceptions as expert events - they merely reflect a capture done with a snapshot length too short to capture all of the packet (any case where it's caused by something else is a bug). svn path=/trunk/; revision=15776
40 lines
1.7 KiB
C
40 lines
1.7 KiB
C
/* gnuc_format_check.h
|
|
* Definitions of macro to conditionally do GCC format checks
|
|
*
|
|
* $Id$
|
|
*
|
|
* Ethereal - Network traffic analyzer
|
|
* By Gerald Combs <gerald@ethereal.com>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef __GNUC_FORMAT_CHECK_H__
|
|
#define __GNUC_FORMAT_CHECK_H__
|
|
|
|
/** GNUC has the ability to check format strings that follow the syntax used in printf and others.
|
|
Hide the differences between different compilers in this GNUC_FORMAT_CHECK macro.
|
|
@param archetype one of: printf, scanf, strftime or strfmon
|
|
@param string_index specifies which argument is the format string argument (starting from 1)
|
|
@param first_to_check is the number of the first argument to check against the format string */
|
|
#if __GNUC__ >= 2
|
|
#define GNUC_FORMAT_CHECK(archetype, string_index, first_to_check) __attribute__((format (archetype, string_index, first_to_check)))
|
|
#else
|
|
#define GNUC_FORMAT_CHECK(archetype, string_index, first_to_check)
|
|
#endif
|
|
|
|
#endif /* gnuc-format-check.h */
|