This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpp -dD broken (patch)
On Mon, Mar 06, 2000 at 02:19:41PM -0500, Craig Newell wrote:
>
> Hi All,
>
> cpp -dD is currently broken in the CVS tree. A simple test case to show
> this is:
>
> ---- test.h ----
> #define macro(x,y) (x) + (y)
> ----------------
>
> Which when processed with "cpp -dD -P test.h" results in:
>
> ---- test.i ----
> #define macro(, x) () + (x)
> ----------------
>
> I would have to guess that this is just a simple logic error wrt. to the
> recent cpp reorganisation ... so here is a quick patch to make it work
> again (assuming that "cpp -dD" is the only thing broken).
Thanks for the bug report. You've correctly identified the problem,
but your fix is not quite right - the argnames string can't be
modified. Yes, it's being modified now, but that's another bug.
The right fix is to make the argnames string be \0-separated from the
beginning, and change compare_definitions to deal with that. I'll put
out a patch to that effect shortly.
Do you have a copyright assignment on file? We can't accept any
nontrivial patches from you without one.
zw