c-common.c (init_function_format_info): Add C99 format functions in C99 mode.
authorJoseph Myers <jsm28@cam.ac.uk>
Mon, 31 Jul 2000 14:00:34 +0000 (08:00 -0600)
committerJeff Law <law@gcc.gnu.org>
Mon, 31 Jul 2000 14:00:34 +0000 (08:00 -0600)
* c-common.c (init_function_format_info): Add C99 format functions
in C99 mode.

From-SVN: r35380

gcc/ChangeLog
gcc/c-common.c

index cd97f09c81e3482e6738cad12e30b749c10bcadf..c2a385c735e23a3686a4149c812b5adff7d089ca 100644 (file)
@@ -1,5 +1,8 @@
 2000-07-31  Joseph S. Myers  <jsm28@cam.ac.uk>
 
+       * c-common.c (init_function_format_info): Add C99 format functions
+       in C99 mode.
+
        * c-decl.c (get_parm_info): Don't treat 'const void', 'volatile
        void' or 'register void' as being the special case of 'void' alone
        in a parameter list.
index c7b560122063f898510d1ab726c55a9e998b8f53..11f16498c4247cf79cd9be94c1845e20640f4535 100644 (file)
@@ -1335,6 +1335,21 @@ init_function_format_info ()
   record_function_format (get_identifier ("strftime"), NULL_TREE,
                          strftime_format_type, 3, 0);
 
+  if (flag_isoc99)
+    {
+      /* ISO C99 adds the snprintf and vscanf family functions.  */
+      record_function_format (get_identifier ("snprintf"), NULL_TREE,
+                             printf_format_type, 3, 4);
+      record_function_format (get_identifier ("vsnprintf"), NULL_TREE,
+                             printf_format_type, 3, 0);
+      record_function_format (get_identifier ("vscanf"), NULL_TREE,
+                             scanf_format_type, 1, 0);
+      record_function_format (get_identifier ("vfscanf"), NULL_TREE,
+                             scanf_format_type, 2, 0);
+      record_function_format (get_identifier ("vsscanf"), NULL_TREE,
+                             scanf_format_type, 2, 0);
+    }
+
   record_international_format (get_identifier ("gettext"), NULL_TREE, 1);
   record_international_format (get_identifier ("dgettext"), NULL_TREE, 2);
   record_international_format (get_identifier ("dcgettext"), NULL_TREE, 2);