Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Static analysis tools to catch use of reserved identifiers?

37 views
Skip to first unread message

Anthony Cuozzo

unread,
Feb 7, 2024, 10:13:24 AMFeb 7
to
My inspiration is this post: https://news.ycombinator.com/item?id=39275575

I'm interested in knowing if there are any static analysis tools which
catch uses of reserved identifier patterns under standard C in addition
to those reserved under POSIX.

(Please forgive me if "identifier" is the wrong term here. I'm
interested in looking at variable names, function names, typedef names,
struct/union/enum (and their members) names, preprocessor macro names, etc.)

Thanks,
--Anthony

Malcolm McLean

unread,
Feb 7, 2024, 10:19:57 AMFeb 7
to
On 07/02/2024 15:13, Anthony Cuozzo wrote:
>
> (Please forgive me if "identifier" is the wrong term here. I'm
> interested in looking at variable names, function names, typedef names,
> struct/union/enum (and their members) names, preprocessor macro names,
> etc.)
>
>
'But "glory" doesn't mean "a nice knock-down argument",' Alice objected.

'When I use a word,' Humpty Dumpty said, in rather a scornful tone, 'it
means just what I choose it to mean — neither more nor less.'

'The question is,' said Alice, 'whether you can make words mean so many
different things.'

'The question is,' said Humpty Dumpty, 'which is to be master — that's
all.'
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Keith Thompson

unread,
Feb 7, 2024, 11:39:01 AMFeb 7
to
Anthony Cuozzo <ant...@cuozzo.us> writes:
> My inspiration is this post: https://news.ycombinator.com/item?id=39275575

According to that post clang's "-Wreserved-identifier" option warns
about identifiers that are reserved by the C standard.

> I'm interested in knowing if there are any static analysis tools which
> catch uses of reserved identifier patterns under standard C in
> addition to those reserved under POSIX.
>
> (Please forgive me if "identifier" is the wrong term here. I'm
> interested in looking at variable names, function names, typedef
> names, struct/union/enum (and their members) names, preprocessor macro
> names, etc.)

If I understand you correctly, "identifier" is exactly the right term.

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */
0 new messages