C++: int stack[] cannot be declared global

Adrian Thurston thurs... at cs.queensu.ca
Thu Feb 14 23:04:20 UTC 2008

You can rename it using the variable or access statements.


On Feb 14, 5:50 pm, Manoj Rajagopalan <ma... at nanorex.com> wrote:
> Hi Adrian,
>    This causes a clash with std::stack that comes with some STL
> packages. On my Fedora 8 machine with gcc v4.1.2 and libstdc++ v4.1.2, I
> get errors like the following:
> mmp-parser.rl:187: error: reference to 'stack' is ambiguous
> mmp-parser.rl:215: error: candidates are: int stack [1000]
> /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_stack.h:72:
> error:                 template<class _Tp, class _Sequence> class std::stack
>    Any suggestions? Would I be too bold in suggesting that the stack
> variable in ragel be renamed to something like ragelstack?
> cheers

More information about the ragel-users mailing list