re PR c++/46024 (g++.dg/warn/miss-format-1.C FAILs on Solaris 8 and 9)

fixincludes:
	PR c++/46024
	* inclhack.def (solaris_sys_va_list): New fix.
	* fixincl.x: Regenerate.
	* tests/base/sys/va_list.h: New test.

	gcc/testsuite:
	PR c++/46024
	* g++.dg/warn/miss-format-1.C: Enclose dg-error target list in braces.

From-SVN: r165731
This commit is contained in:
Rainer Orth 2010-10-20 17:36:15 +00:00 committed by Rainer Orth
parent 4244a86e66
commit 1e335ae287
6 changed files with 119 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2010-10-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR c++/46024
* inclhack.def (solaris_sys_va_list): New fix.
* fixincl.x: Regenerate.
* tests/base/sys/va_list.h: New test.
2010-09-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* inclhack.def (hpux_htonl): Allow trailing whitespace in select.

View File

@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
* It has been AutoGen-ed Tuesday September 7, 2010 at 10:44:48 AM EDT
* It has been AutoGen-ed Monday October 18, 2010 at 11:11:18 PM MEST
* From the definitions inclhack.def
* and the template file fixincl
*/
/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Sep 7 10:44:48 EDT 2010
/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Oct 18 23:11:18 MEST 2010
*
* You must regenerate it. Use the ./genfixes script.
*
@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
* This file contains 208 fixup descriptions.
* This file contains 209 fixup descriptions.
*
* See README for more information.
*
@ -6971,6 +6971,51 @@ static const char* apzSolaris_Stdio_TagPatch[] = { sed_cmd_z,
"-e", "s/defined(__cplusplus) && (__cplusplus < 54321L)/0/",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Solaris_Sys_Va_List fix
*/
tSCC zSolaris_Sys_Va_ListName[] =
"solaris_sys_va_list";
/*
* File name selection pattern
*/
tSCC zSolaris_Sys_Va_ListList[] =
"sys/va_list.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzSolaris_Sys_Va_ListMachs[] = {
"*-*-solaris2.[89]",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Sys_Va_ListSelect0[] =
"#if.*__STDC__.*\n\
typedef void \\*__va_list;\n\
#else\n\
typedef char \\*__va_list;\n\
#endif";
#define SOLARIS_SYS_VA_LIST_TEST_CT 1
static tTestDesc aSolaris_Sys_Va_ListTests[] = {
{ TT_EGREP, zSolaris_Sys_Va_ListSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Solaris_Sys_Va_List
*/
static const char* apzSolaris_Sys_Va_ListPatch[] = {
"format",
"#ifdef __GNUC__\n\
typedef __builtin_va_list __va_list;\n\
#else\n\
%0\n\
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Statsswtch fix
@ -8470,9 +8515,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
#define REGEX_COUNT 247
#define REGEX_COUNT 248
#define MACH_LIST_SIZE_LIMIT 181
#define FIX_COUNT 208
#define FIX_COUNT 209
/*
* Enumerate the fixes
@ -8649,6 +8694,7 @@ typedef enum {
SOLARIS_INT_LIMITS_3_FIXIDX,
SOLARIS_INT_TYPES_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX,
SOLARIS_SYS_VA_LIST_FIXIDX,
STATSSWTCH_FIXIDX,
STDIO_STDARG_H_FIXIDX,
STDIO_VA_LIST_FIXIDX,
@ -9544,6 +9590,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SOLARIS_STDIO_TAG_TEST_CT, FD_MACH_ONLY,
aSolaris_Stdio_TagTests, apzSolaris_Stdio_TagPatch, 0 },
{ zSolaris_Sys_Va_ListName, zSolaris_Sys_Va_ListList,
apzSolaris_Sys_Va_ListMachs,
SOLARIS_SYS_VA_LIST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Sys_Va_ListTests, apzSolaris_Sys_Va_ListPatch, 0 },
{ zStatsswtchName, zStatsswtchList,
apzStatsswtchMachs,
STATSSWTCH_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,

View File

@ -3693,6 +3693,34 @@ fix = {
};
/*
* On Solaris 8 and 9, __va_list needs to become a typedef for
* __builtin_va_list to make -Wmissing-format-attribute work.
*/
fix = {
hackname = solaris_sys_va_list;
files = sys/va_list.h;
mach = '*-*-solaris2.[89]';
select = "#if.*__STDC__.*\n"
"typedef void \\*__va_list;\n"
"#else\n"
"typedef char \\*__va_list;\n"
"#endif";
c_fix = format;
c_fix_arg = "#ifdef __GNUC__\n"
"typedef __builtin_va_list __va_list;\n"
"#else\n"
"%0\n"
"#endif";
test_text = "#if defined(__STDC__) && !defined(__ia64)\n"
"typedef void *__va_list;\n"
"#else\n"
"typedef char *__va_list;\n"
"#endif";
};
/*
* a missing semi-colon at the end of the statsswtch structure definition.
*/

View File

@ -0,0 +1,22 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/sys/va_list.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( SOLARIS_SYS_VA_LIST_CHECK )
#ifdef __GNUC__
typedef __builtin_va_list __va_list;
#else
#if defined(__STDC__) && !defined(__ia64)
typedef void *__va_list;
#else
typedef char *__va_list;
#endif
#endif
#endif /* SOLARIS_SYS_VA_LIST_CHECK */

View File

@ -1,3 +1,8 @@
2010-10-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR c++/46024
* g++.dg/warn/miss-format-1.C: Enclose dg-error target list in braces.
2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
PR c++/46056

View File

@ -4,7 +4,7 @@
/* { dg-options "-Wmissing-format-attribute" } */
/* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */
/* VxWorks does not provide vscanf, either in kernel or RTP mode. */
/* { dg-error "not declared" "" { target *-*-solaris2.8 *-*-vxworks* alpha*-dec-osf5* } 26 } */
/* { dg-error "not declared" "" { target { *-*-solaris2.8 *-*-vxworks* alpha*-dec-osf5* } } 26 } */
#include <stdio.h>
#include <stdarg.h>