Re: [committed] Fix declaration of vsscanf on hpux

2016-02-01 Thread Bruce Korb

On 01/31/16 17:03, John David Anglin wrote:

The attached hack fixes missing const from the first argument of the 
declararation for vsscanf on hpux.


Approved for all active dev branches.


[committed] Fix declaration of vsscanf on hpux

2016-01-31 Thread John David Anglin
The attached hack fixes missing const from the first argument of the 
declararation for vsscanf on hpux.
This has been present forever.  sscanf is correctly declared, so I presume this 
is a typo.

I limited the fix to hpux since stage3 is over.

Tested on hppa2.0w-hp-hpux11.11.

Committed to trunk.

Dave
--
John David Anglin   dave.ang...@bell.net


2016-01-31  John David Anglin  

PR target/68741
* inclhack.def (hpux_vsscanf): New fix.
* fixincl.x: Regenerated.
* tests/base/stdio.h [HPUX_VSSCANF_CHECK]: New test.

Index: inclhack.def
===
--- inclhack.def(revision 232999)
+++ inclhack.def(working copy)
@@ -2273,6 +2273,20 @@
 };
 
 /*
+ *  Fix missing const in hpux vsscanf declaration
+ */
+fix = {
+hackname = hpux_vsscanf;
+mach= "*-*-hpux*";
+files   = stdio.h;
+select  = '(extern int vsscanf\()char';
+c_fix   = format;
+c_fix_arg = "%1const char";
+
+test_text = 'extern int vsscanf(char *, const char *, __va_list);';
+};
+
+/*
  *  get rid of bogus inline definitions in HP-UX 8.0
  */
 fix = {
Index: tests/base/stdio.h
===
--- tests/base/stdio.h  (revision 232999)
+++ tests/base/stdio.h  (working copy)
@@ -59,6 +59,11 @@
 #endif  /* HPUX11_VSNPRINTF_CHECK */
 
 
+#if defined( HPUX_VSSCANF_CHECK )
+extern int vsscanf(const char *, const char *, __gnuc_va_list);
+#endif  /* HPUX_VSSCANF_CHECK */
+
+
 #if defined( IRIX_STDIO_DUMMY_VA_LIST_CHECK )
 extern int printf( const char *, __gnuc_va_list );
 #endif  /* IRIX_STDIO_DUMMY_VA_LIST_CHECK */