Re: [PATCH v2 4/8] Specify explicitly where we parse timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Torsten,

On Mon, 3 Apr 2017, Torsten Bögershausen wrote:

> []
> > --- a/git-compat-util.h
> > +++ b/git-compat-util.h
> > @@ -319,6 +319,8 @@ extern char *gitdirname(char *);
> >  #define PRIo32 "o"
> >  #endif
> >
> > +#define parse_timestamp strtoul
> > +
> 
> Would
> #define parse_timestamp(a,b,c)  strtoul((a),(b),(c))
> be more strict ?

It would be more pedantic. But I fail to see how it would be more strict:
once the preprocessor substituted `parse_timestamp` for whatever we
#define'd it to, the C compiler will then validate the calls against the
signature of the real function. That validation will be much more strict
than merely testing for the correct number of parameters.

Ciao,
Johannes

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]