mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-03 16:54:27 +08:00
cpptrad.c (_cpp_replacement_text_len): Add check for macro parameter count.
* cpptrad.c (_cpp_replacement_text_len): Add check for macro parameter count. (_cpp_copy_replacement_text): Same. * gcc.dg/cpp/trad/funlike-5.c: New test. From-SVN: r65952
This commit is contained in:
parent
1067694a52
commit
f945b4e0f5
@ -1,3 +1,9 @@
|
||||
|
||||
2003-04-22 Devang Patel <dpatel@apple.com>
|
||||
|
||||
* cpptrad.c (_cpp_replacement_text_len): Add check for macro parameter count.
|
||||
(_cpp_copy_replacement_text): Same.
|
||||
|
||||
2003-04-22 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
* c-lex.c (c_lex): Handle CPP_OTHER differently.
|
||||
@ -57,6 +63,7 @@
|
||||
(note_eh_region_may_contain_throw): New function.
|
||||
* except.h (note_eh_region_may_contain_throw): New function.
|
||||
|
||||
>>>>>>> 1.17566
|
||||
2003-04-21 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* config/i386/winnt.c (i386_pe_mark_dllimport): Revert previous
|
||||
|
@ -761,7 +761,7 @@ _cpp_replacement_text_len (macro)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (macro->fun_like)
|
||||
if (macro->fun_like && (macro->paramc != 0))
|
||||
{
|
||||
const uchar *exp;
|
||||
|
||||
@ -791,7 +791,7 @@ _cpp_copy_replacement_text (macro, dest)
|
||||
const cpp_macro *macro;
|
||||
uchar *dest;
|
||||
{
|
||||
if (macro->fun_like)
|
||||
if (macro->fun_like && (macro->paramc != 0))
|
||||
{
|
||||
const uchar *exp;
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
|
||||
2003-04-22 Devang Patel <dpatel@apple.com>
|
||||
|
||||
* gcc.dg/cpp/trad/funlike-5.c: New test.
|
||||
|
||||
2003-04-21 Andreas Tobler <a.tobler@schweiz.ch>
|
||||
|
||||
* g++.dg/other/packed1.C: Fix dg options.
|
||||
|
10
gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
Normal file
10
gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
Normal file
@ -0,0 +1,10 @@
|
||||
/* Test function like macro. */
|
||||
/* Contributed by Devang Patel <dpatel@apple.com> */
|
||||
|
||||
/* {do-do preprocess } */
|
||||
/* { dg-options "-traditional-cpp -E -dD" } */
|
||||
int __srget (char *);
|
||||
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
|
||||
#define getc(fp) __sgetc(fp)
|
||||
#define getchar() getc(stdin)
|
||||
|
Loading…
Reference in New Issue
Block a user