Re: [hackers] [farbfeld] arg.h: Refactor ARGF_() || Laslo Hunhold

From: Richard Ipsum <richardipsum_AT_fastmail.co.uk>
Date: Fri, 4 Aug 2017 16:56:15 +0100

On Fri, Aug 04, 2017 at 08:37:14AM -0700, Michael Forney wrote:
> On 8/4/17, git_AT_suckless.org <git_AT_suckless.org> wrote:
> > commit 959b70ab5a7f7801f7047b9d513671cd95500488
> > Author: Laslo Hunhold <dev_AT_frign.de>
> > AuthorDate: Fri Aug 4 16:11:12 2017 +0200
> > Commit: Laslo Hunhold <dev_AT_frign.de>
> > CommitDate: Fri Aug 4 16:11:12 2017 +0200
> >
> > arg.h: Refactor ARGF_()
> >
> > diff --git a/arg.h b/arg.h
> > index 81127a2..042f5c1 100644
> > --- a/arg.h
> > +++ b/arg.h
> > _AT_@ -24,15 +24,15 @@ extern char *argv0;
> > /* int main(int argc, char *argv[]) */
> > #define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) : ((void
> > *)0); \
> > *argv && (*argv)[0] == '-' && (*argv)[1]; argc--,
> > argv++) { \
> > - int i, argused;
> > \
> > + int _i, _argused;
>
> You can't use identifiers that begin with '_', they are reserved for
> the C implementation:
>
> "All identifiers that begin with an underscore are always reserved for
> use as identifiers with file scope in both the ordinary and tag name
> spaces."

This crossed my mind as well, but then we notice that these aren't
defined in file scope. If you have two underscores however that's
reserved regardless of use.

"In addition to the names documented in this manual, reserved names include all external identifiers (global functions and variables) that begin with an underscore (‘_’) and all identifiers regardless of use that begin with either two underscores or an underscore followed by a capital letter are reserved names. This is so that the library and header files can define functions, variables, and macros for internal purposes without risk of conflict with names in user programs."[1]

Thanks,
Richard

[1]: https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html

-- 
Life is too short for POSIX compliance
Received on Fri Aug 04 2017 - 17:56:15 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 04 2017 - 18:01:58 CEST