diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2014-12-11 09:15:37 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2014-12-11 09:15:37 +0100 |
commit | 01ca36af914385acfc864adfae6923768581888a (patch) | |
tree | 73160bf616558a6ddfc1ac73519216a81c9d0e8a /libcpp | |
parent | c168eab92cc42d3c995cc0a1188e1554ebbcd63a (diff) | |
download | gcc-01ca36af914385acfc864adfae6923768581888a.zip gcc-01ca36af914385acfc864adfae6923768581888a.tar.gz gcc-01ca36af914385acfc864adfae6923768581888a.tar.bz2 |
xvasprintf.c: New file.
* xvasprintf.c: New file.
* vprintf-support.h: Likewise.
* vprintf-support.c: Likewise.
* Makefile.in (CFILES): Add vprintf-support.c, xvasprintf.c.
(REQUIRED_OFILES): Add vprintf-support.$(objext), xvasprintf.$(objext).
(vprintf-support.$(objext), xvasprintf.$(objext)): New targets.
(vasprintf.$(objext)): Depend on $(srcdir)/vprintf-support.h.
* functions.texi: Regenerate.
* vasprintf.c (int_vasprintf): Use libiberty_vprintf_buffer_size.
include/ChangeLog:
* libiberty.h (xvasprintf): Declare.
libcpp/ChangeLog:
* directives.c (cpp_define_formatted): Use xvasprintf.
Co-Authored-By: Ben Elliston <bje@au.ibm.com>
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r218618
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 4 | ||||
-rw-r--r-- | libcpp/directives.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index e26c8c9..df71ac2 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,7 @@ +2014-12-11 Uros Bizjak <ubizjak@gmail.com> + + * directives.c (cpp_define_formatted): Use xvasprintf. + 2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org> * line-map.c (linemap_position_for_loc_and_offset): Add new diff --git a/libcpp/directives.c b/libcpp/directives.c index ba92ec2..c9be412 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -2404,11 +2404,11 @@ cpp_define (cpp_reader *pfile, const char *str) void cpp_define_formatted (cpp_reader *pfile, const char *fmt, ...) { - char *ptr = NULL; + char *ptr; va_list ap; va_start (ap, fmt); - vasprintf (&ptr, fmt, ap); + ptr = xvasprintf (fmt, ap); va_end (ap); cpp_define (pfile, ptr); |