Skip to content

Commit

Permalink
Omit unnecessary double-underscores
Browse files Browse the repository at this point in the history
This follows up on a comment by Russ Allbery in:
https://mm.icann.org/pipermail/tz/2022-November/032310.html
* private.h (ATTRIBUTE_MALLOC, ATTRIBUTE_PURE)
(ATTRIBUTE_FORMAT, ATTRIBUTE_MAYBE_UNUSED, _Noreturn): Omit double
underscores around attributes.  They aren’t needed, since
private.h is not a public include file so we don’t need to worry
about includers #defining ‘pure’ etc.
  • Loading branch information
eggert committed Nov 21, 2022
1 parent 53b3f12 commit 15c01af
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions private.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ typedef unsigned long uintmax_t;

#if 3 <= __GNUC__
# define ATTRIBUTE_CONST __attribute__((const))
# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
# define ATTRIBUTE_PURE __attribute__((__pure__))
# define ATTRIBUTE_FORMAT(spec) __attribute__((__format__ spec))
# define ATTRIBUTE_MALLOC __attribute__((malloc))
# define ATTRIBUTE_PURE __attribute__((pure))
# define ATTRIBUTE_FORMAT(spec) __attribute__((format spec))
#else
# define ATTRIBUTE_CONST /* empty */
# define ATTRIBUTE_MALLOC /* empty */
Expand All @@ -434,21 +434,21 @@ typedef unsigned long uintmax_t;
#endif

#ifdef __has_c_attribute
# if __has_c_attribute(__maybe_unused__)
# define ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# if __has_c_attribute(maybe_unused)
# define ATTRIBUTE_MAYBE_UNUSED [[maybe_unused]]
# endif
#endif
#ifndef ATTRIBUTE_MAYBE_UNUSED
# if 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
# define ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
# define ATTRIBUTE_MAYBE_UNUSED __attribute__((unused))
# else
# define ATTRIBUTE_MAYBE_UNUSED /* empty */
# endif
#endif

#if !defined _Noreturn && __STDC_VERSION__ < 201112
# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__)
# define _Noreturn __attribute__((__noreturn__))
# define _Noreturn __attribute__((noreturn))
# else
# define _Noreturn
# endif
Expand Down

0 comments on commit 15c01af

Please sign in to comment.