diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-08-29 18:37:37 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-08-29 18:37:37 +0000 |
commit | 2c8f0515bbed378f1e87e1b52e2913d058cbed16 (patch) | |
tree | 7f03453e92f612da7c6531488d3878a73dbda657 /gcc/cppinit.c | |
parent | 5c5d1cd68a748299a244a6b9fd7c3fce2f09d582 (diff) | |
download | gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.zip gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.gz gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.bz2 |
cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename.
* cpperror.c (print_file_and_line): If line is (unsigned int)-1,
print just the filename.
* cpplex.c (_cpp_run_directive): Add additional argument, the
name to give the synthetic buffer. This defaults to
translated "<command line>".
* cpplib.c (cpp_define, cpp_undef, cpp_assert, cpp_unassert):
Adjust to match.
(_cpp_define_builtin): New function.
* cppinit.c (initialize_builtins): Use _cpp_define_builtin.
* cpphash.h: Update prototypes.
* tradcpp.c (main): Process -D and -U simultaneously, in the
order they appeared on the command line.
From-SVN: r36043
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index f1ed54f..fbccfc3 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -610,9 +610,9 @@ initialize_builtins (pfile) if (b->flags & VERS) { - /* Allocate enough space for 'name="value"\0'. */ - str = xmalloc (b->len + strlen (version_string) + 4); - sprintf (str, "%s=\"%s\"", b->name, version_string); + /* Allocate enough space for 'name "value"\n\0'. */ + str = alloca (b->len + strlen (version_string) + 5); + sprintf (str, "%s \"%s\"\n", b->name, version_string); } else { @@ -621,13 +621,12 @@ initialize_builtins (pfile) else val = b->value; - /* Allocate enough space for "name=value\0". */ - str = xmalloc (b->len + strlen (val) + 2); - sprintf(str, "%s=%s", b->name, val); + /* Allocate enough space for "name value\n\0". */ + str = alloca (b->len + strlen (val) + 3); + sprintf(str, "%s %s\n", b->name, val); } - cpp_define (pfile, str); - free (str); + _cpp_define_builtin (pfile, str); } else { |