[PATCH] Replace errs and mem subroutines to separate files

Edgar Kaziahmedov edos at linux.com
Tue Jun 27 00:32:38 UTC 2017


On Tue, 27 Jun 2017 02:30:12 +0300
"Dmitry V. Levin" <ldv at altlinux.org> wrote:

> On Tue, Jun 27, 2017 at 12:21:52AM +0300, Dmitry V. Levin wrote:
> > On Mon, Jun 26, 2017 at 09:05:31PM +0300, Edgar Kaziahmedov wrote:  
> [...]
> > > +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) +
> > > MUST_BE_ARRAY(a)) +
> > > +void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf,
> > > 1, 2)); +void perror_msg(const char *fmt, ...)
> > > ATTRIBUTE_FORMAT((printf, 1, 2)); +void perror_msg_and_die(const
> > > char *fmt, ...)
> > > +	ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
> > > +void error_msg_and_help(const char *fmt, ...)
> > > +	ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
> > > +void error_msg_and_die(const char *fmt, ...)
> > > +	ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
> > > +void die_out_of_memory(void) ATTRIBUTE_NORETURN;
> > > +
> > > +void *xcalloc(size_t nmemb, size_t size)
> > > +	ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2));
> > > +void *xmalloc(size_t size) ATTRIBUTE_MALLOC
> > > ATTRIBUTE_ALLOC_SIZE((1)); +void *xreallocarray(void *ptr, size_t
> > > nmemb, size_t size)
> > > +	ATTRIBUTE_ALLOC_SIZE((2, 3));
> > > +char *xstrdup(const char *str) ATTRIBUTE_MALLOC;
> > > +char *xstrndup(const char *str, size_t n) ATTRIBUTE_MALLOC;  
> > 
> > This looks to me like three different groups of declarations.  
> 
> I was unsure what group die_out_of_memory belongs to,
> and why should it be exported in the first place.
> After some thought I've decided to unexport it.
> 
> 

It isn't clear what do you mean, you imply that it's quite obviously
what group die_out_of_memory has to belong to? error_prints or xmalloc
group? 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170627/5734c3ee/attachment.bin>


More information about the Strace-devel mailing list