This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -fdump-go-spec option does not handle redefinitions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]