This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fdump-go-spec option does not handle redefinitions
- From: Ian Lance Taylor <iant at google dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Thu, 27 Oct 2011 12:29:12 -0700
- Subject: Re: -fdump-go-spec option does not handle redefinitions
- References: <CAFULd4bJ5vfBQXWEM4n-dE1eAb5UKdgK423gj+sqvvjves7oMQ@mail.gmail.com>
Uros Bizjak <ubizjak@gmail.com> writes:
> This testfile:
>
> #define aa 2
> #undef aa
> #define aa 3
>
> does not generate correct output with -fdump-go-spec. The result is:
>
> const _aa = 2
> // undef _aa
>
> One would expect:
>
> const _aa = 2
> // undef _aa
> const _aa = 3
Did this come up in a real situation?
The problem with your proposal is that the output would be invalid Go,
because it would attempt to define the name _aa twice. However, it does
seem plausible that in most scenarios of this type it would be more
useful for -fdump-go-spec to generate
const _aa = 3
Ian