bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems compiling groff with gcc-3.0.3


From: Hans Aberg
Subject: Re: problems compiling groff with gcc-3.0.3
Date: Tue, 29 Jan 2002 00:25:10 +0100

At 12:53 -0800 2002/01/28, Paul Eggert wrote:
>> Note that we defined YYSIZE_T and YYSTACK_ALLOC here.
>
>I think this is the fundamental problem.  The code assumes that if alloca
>is asked for, then size_t (or std::size_t) has already been declared.
>Apparently that is not true in general.

This seems to be correct: alloca is typically a macro. My <alloca.h> file
only contains
  #define alloca(x) __alloca(x)
where __alloca is a library function, only accessed by the linker then.

So under STD C, one should include <stddef.h>.

Under STD C++, it is <cstddef> or <stddef.h>: I can note that the C++ I
tested it onto, is using alloca and includes <cstddef>; preprocessing and
searching for "using" reveals that there is none such.

So therefore, I think it is <cstddef> you should include.

But I would suggest you try the same with GCC: preprocess the .tab.cc file
and search for "using" to make sure there are none, and see if it compiles
with a <cstddef> include.

-- I am not exactly sure what is exported to the linker, but under C++,
size_t is named std::size_t, and therefore one should be able to use
<cstddef>.

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]