[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/2] RFC: Discourage the use of unbound string literals
From: |
Akim Demaille |
Subject: |
Re: [PATCH 0/2] RFC: Discourage the use of unbound string literals |
Date: |
Tue, 19 Nov 2019 21:13:18 +0100 |
> Le 17 nov. 2019 à 18:37, Akim Demaille <address@hidden> a écrit :
>
> String literals as tokens serve two distinct purposes: freeing from
> having to implement the keyword matching in the scanner, and improving
> error messages. Most of the time both can be achieved at the same
> time, but on occasions, it does not work so well.
>
> We promote their use for error messages, and will still support the
> former case, but it is _not_ the recommended approach.
>
> Besides, string literals, because they don't need to be declared, are
> somewhat dangerous. The new option -Wdangling-alias should help
> catching them. I'm unsure about the proper name for this warning. I
> once used "useless-alias", but it's too strong: some people do use the
> string aliases in their scanners. Could also have been
> -Wunbound-alias. I'd be happy to receive suggestions!
Pushed.