Skip to content

Commit

Permalink
conform: Do not use __SIG_ATOMIC_TYPE__
Browse files Browse the repository at this point in the history
clang does not define __SIG_ATOMIC_TYPE__, instead add another
directive ('size:') which instruct to use an integer type of
defined minimum size.

Reviewed-by: Sam James <sam@gentoo.org>
  • Loading branch information
zatrazz committed Jan 3, 2025
1 parent e9eea05 commit 8ed5371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions conform/conformtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ def gen_subtests(self):
c_type = self.c_type[len('promoted:'):]
text = ('__typeof__ ((%s) 0 + (%s) 0) a2_%d;\n'
% (c_type, c_type, self.num))
elif self.c_type.startswith('size:'):
c_type = "int{}_t".format(self.c_type[len('size:'):])
text = ('__typeof__ ((%s) 0 + (%s) 0) a2_%d;\n'
% (c_type, c_type, self.num))
else:
text = '__typeof__ ((%s) 0) a2_%d;\n' % (self.c_type, self.num)
text += 'extern __typeof__ (%s) a2_%d;\n' % (self.symbol, self.num)
Expand Down
4 changes: 2 additions & 2 deletions conform/data/stdint.h-data
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ macro-int-constant UINTMAX_MAX {promoted:uintmax_t} >= 18446744073709551615ULL
macro-int-constant PTRDIFF_MIN {promoted:__PTRDIFF_TYPE__} <= -65535
macro-int-constant PTRDIFF_MAX {promoted:__PTRDIFF_TYPE__} >= 65535

macro-int-constant SIG_ATOMIC_MIN {promoted:__SIG_ATOMIC_TYPE__}
macro-int-constant SIG_ATOMIC_MAX {promoted:__SIG_ATOMIC_TYPE__} >= 127
macro-int-constant SIG_ATOMIC_MIN {size:__SIG_ATOMIC_WIDTH__}
macro-int-constant SIG_ATOMIC_MAX {size:__SIG_ATOMIC_WIDTH__} >= 127

macro-int-constant SIZE_MAX {promoted:__SIZE_TYPE__} >= 65535

Expand Down

0 comments on commit 8ed5371

Please sign in to comment.