Re: Request for better syntax checking in lang.opt

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Request for better syntax checking in lang.opt

Thomas Koenig-6
Hi Martin,

> Sure, I can improve sanity checking.

Thanks!

> What exactly have you screwed up?
I had, in lang.opt

EnumValue
Enum (gfc_fcoarray) String (native) Value (GFC_FCOARRAY_NATIVE)

It was a bit non-obvious to me that this led to the whole sub-option
being ignored due to

*drum roll*

the space between the keywords and the opening parenthesis.  I have
internalized the GNU style guides to such an extent that I hardly
ever see the space there :-)

Regards

        Thomas
Reply | Threaded
Open this post in threaded view
|

Re: Request for better syntax checking in lang.opt

Martin Liška-2
On 2/20/20 7:08 PM, Thomas Koenig wrote:

> Hi Martin,
>
>> Sure, I can improve sanity checking.
>
> Thanks!
>
>> What exactly have you screwed up?
> I had, in lang.opt
>
> EnumValue
> Enum (gfc_fcoarray) String (native) Value (GFC_FCOARRAY_NATIVE)
>
> It was a bit non-obvious to me that this led to the whole sub-option
> being ignored due to
>
> *drum roll*
>
> the space between the keywords and the opening parenthesis.  I have
> internalized the GNU style guides to such an extent that I hardly
> ever see the space there :-)
Hello.

I was able to write a sanity check for these kind of issues, but it does
not resolve all similar issues for other keywords. It's not easy to do it.

Martin

>
> Regards
>
>      Thomas


0001-Make-more-sanity-checks-for-enums.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Request for better syntax checking in lang.opt

Martin Liška-2
On 2/23/20 10:47 AM, Thomas Koenig wrote:
> Hi Martin,
>
>> I was able to write a sanity check for these kind of issues, but it does
>> not resolve all similar issues for other keywords. It's not easy to do it.
>
> Having looked at the origina awk code, I agree.  Maybe, in the long
> term, a lex/yacc grammar with a monolithic C program to write out
> the headers wold be more suitable.

... or as I suggested, we could use Python. But that was not welcomed
by the community as unnecessary dependency.

>
> Having said that, I think what you did is already quite valuable
> and will save some gcc developers from a few prmature grey hairs :-)

Anyway, I'll send the patch in the next stage1.

Martin

>
> So, I would recommend to commit as is.  Sanity checks do not have
> to be perfect.
>
> Thanks for taking this on!
>
> Regards
>
>      Thomas
>