aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2002-05-14 00:30:25 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2002-05-14 00:30:25 +0000
commit2e0c661e02ce32373be06779cec941e69fb5b955 (patch)
tree86398e3fcc5ae1a4fad1cd40377f2650fbec5667 /contrib
parent5893472b2dea3c1906924a59c8d97fc3db229f33 (diff)
downloadsrc-2e0c661e02ce32373be06779cec941e69fb5b955.tar.gz
src-2e0c661e02ce32373be06779cec941e69fb5b955.zip
Add framework for our kernel printf enhancements.
Notes
Notes: svn path=/head/; revision=96549
Diffstat (limited to 'contrib')
-rw-r--r--contrib/gcc/c-common.h6
-rw-r--r--contrib/gcc/c-decl.c23
-rw-r--r--contrib/gcc/cppinit.c6
3 files changed, 35 insertions, 0 deletions
diff --git a/contrib/gcc/c-common.h b/contrib/gcc/c-common.h
index df74f2e43026..4d2d476decc2 100644
--- a/contrib/gcc/c-common.h
+++ b/contrib/gcc/c-common.h
@@ -19,6 +19,8 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+/* $FreeBSD$ */
+
#ifndef GCC_C_COMMON_H
#define GCC_C_COMMON_H
@@ -433,6 +435,10 @@ extern int flag_isoc94;
extern int flag_isoc99;
+/* Nonzero means allow the BSD kernel printf enhancments. */
+
+extern int flag_bsd_format;
+
/* Nonzero means environment is hosted (i.e., not freestanding) */
extern int flag_hosted;
diff --git a/contrib/gcc/c-decl.c b/contrib/gcc/c-decl.c
index 262825720c4c..46685e274e3b 100644
--- a/contrib/gcc/c-decl.c
+++ b/contrib/gcc/c-decl.c
@@ -19,6 +19,8 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+/* $FreeBSD$ */
+
/* Process declarations and symbol lookup for C front end.
Also constructs types; the standard scalar types at initialization,
and structure, union, array and enum types when they are declared. */
@@ -312,6 +314,10 @@ int flag_isoc94 = 0;
int flag_isoc99 = 0;
+/* Nonzero means allow the BSD kernel printf enhancments. */
+
+int flag_bsd_format = 0;
+
/* Nonzero means that we have builtin functions, and main is an int */
int flag_hosted = 1;
@@ -508,6 +514,7 @@ c_decode_option (argc, argv)
-std=c99 same as -std=iso9899:1999
-std=gnu89 default, iso9899:1990 + gnu extensions
-std=gnu99 iso9899:1999 + gnu extensions
+ -std=bsd iso9899:1999 + BSD kernel printf extensions
*/
const char *const argstart = &p[5];
@@ -523,6 +530,7 @@ c_decode_option (argc, argv)
flag_no_nonansi_builtin = 1;
flag_noniso_default_format_attributes = 0;
flag_isoc99 = 0;
+ flag_bsd_format = 0;
}
else if (!strcmp (argstart, "iso9899:199409"))
{
@@ -541,6 +549,7 @@ c_decode_option (argc, argv)
flag_noniso_default_format_attributes = 0;
flag_isoc99 = 1;
flag_isoc94 = 1;
+ flag_bsd_format = 0;
}
else if (!strcmp (argstart, "gnu89"))
{
@@ -551,6 +560,7 @@ c_decode_option (argc, argv)
flag_noniso_default_format_attributes = 1;
flag_isoc99 = 0;
flag_isoc94 = 0;
+ flag_bsd_format = 0;
}
else if (!strcmp (argstart, "gnu9x") || !strcmp (argstart, "gnu99"))
{
@@ -561,6 +571,19 @@ c_decode_option (argc, argv)
flag_noniso_default_format_attributes = 1;
flag_isoc99 = 1;
flag_isoc94 = 1;
+ flag_bsd_format = 0;
+ }
+ else if (!strcmp (argstart, "bsd"))
+ {
+ flag_traditional = 0;
+ flag_writable_strings = 0;
+ flag_no_asm = 0;
+ flag_no_nonansi_builtin = 0;
+ flag_noniso_default_format_attributes = 1;
+ flag_isoc99 = 0;
+ flag_isoc94 = 0;
+ flag_isoc94 = 0;
+ flag_bsd_format = 1;
}
else
error ("unknown C standard `%s'", argstart);
diff --git a/contrib/gcc/cppinit.c b/contrib/gcc/cppinit.c
index 872ba6d60394..d15a884dca5c 100644
--- a/contrib/gcc/cppinit.c
+++ b/contrib/gcc/cppinit.c
@@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
#include "system.h"
#include "cpplib.h"
@@ -1225,6 +1227,7 @@ new_pending_directive (pend, text, handler)
DEF_OPT("std=gnu89", 0, OPT_std_gnu89) \
DEF_OPT("std=gnu99", 0, OPT_std_gnu99) \
DEF_OPT("std=gnu9x", 0, OPT_std_gnu9x) \
+ DEF_OPT("std=bsd", 0, OPT_std_bsd) \
DEF_OPT("std=iso9899:1990", 0, OPT_std_iso9899_1990) \
DEF_OPT("std=iso9899:199409", 0, OPT_std_iso9899_199409) \
DEF_OPT("std=iso9899:1999", 0, OPT_std_iso9899_1999) \
@@ -1510,6 +1513,9 @@ cpp_handle_option (pfile, argc, argv, ignore)
case OPT_std_gnu99:
set_lang (pfile, CLK_GNUC99);
break;
+ case OPT_std_bsd:
+ set_lang (pfile, CLK_GNUC89);
+ break;
case OPT_std_iso9899_199409:
set_lang (pfile, CLK_STDC94);
break;