Skip to content

Commit 0ef3648

Browse files
committed
Walk back most uses of __STRICT_ANSI__
1 parent 7c7bf4b commit 0ef3648

File tree

11 files changed

+109
-193
lines changed

11 files changed

+109
-193
lines changed

build/objdump

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ if [ -n "$OBJDUMP" ]; then
66
fi
77

88
find_objdump() {
9-
if [ -x .cosmocc/3.3/bin/$1-linux-cosmo-objdump ]; then
10-
OBJDUMP=.cosmocc/3.3/bin/$1-linux-cosmo-objdump
11-
elif [ -x .cosmocc/3.3/bin/$1-linux-musl-objdump ]; then
12-
OBJDUMP=.cosmocc/3.3/bin/$1-linux-musl-objdump
13-
elif [ -x "$COSMO/.cosmocc/3.3/bin/$1-linux-cosmo-objdump" ]; then
14-
OBJDUMP="$COSMO/.cosmocc/3.3/bin/$1-linux-cosmo-objdump"
15-
elif [ -x "$COSMO/.cosmocc/3.3/bin/$1-linux-musl-objdump" ]; then
16-
OBJDUMP="$COSMO/.cosmocc/3.3/bin/$1-linux-musl-objdump"
9+
if [ -x .cosmocc/3.3.1/bin/$1-linux-cosmo-objdump ]; then
10+
OBJDUMP=.cosmocc/3.3.1/bin/$1-linux-cosmo-objdump
11+
elif [ -x .cosmocc/3.3.1/bin/$1-linux-musl-objdump ]; then
12+
OBJDUMP=.cosmocc/3.3.1/bin/$1-linux-musl-objdump
13+
elif [ -x "$COSMO/.cosmocc/3.3.1/bin/$1-linux-cosmo-objdump" ]; then
14+
OBJDUMP="$COSMO/.cosmocc/3.3.1/bin/$1-linux-cosmo-objdump"
15+
elif [ -x "$COSMO/.cosmocc/3.3.1/bin/$1-linux-musl-objdump" ]; then
16+
OBJDUMP="$COSMO/.cosmocc/3.3.1/bin/$1-linux-musl-objdump"
1717
else
1818
echo "error: toolchain not found (try running 'cosmocc --update' or 'make' in the cosmo monorepo)" >&2
1919
exit 1

libc/errno.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@ COSMOPOLITAN_C_START_
2222
* @see libc/sysv/dos2errno.sh for multimapped numbers
2323
*/
2424

25-
#if defined(__GNUC__) && defined(__aarch64__) && !defined(__STRICT_ANSI__) && \
26-
!defined(__cplusplus)
25+
#if defined(__GNUC__) && defined(__aarch64__) && !defined(__cplusplus)
2726
/* this header is included by 700+ files; therefore we */
2827
/* hand-roll &__get_tls()->tib_errno to avoid #include */
2928
/* cosmopolitan uses x28 as the tls register b/c apple */
30-
#define errno \
31-
(*({ \
32-
errno_t *__ep; \
33-
asm("sub\t%0,x28,#192-0x3c" : "=r"(__ep)); \
34-
__ep; \
29+
#define errno \
30+
(*__extension__({ \
31+
errno_t *__ep; \
32+
__asm__("sub\t%0,x28,#192-0x3c" : "=r"(__ep)); \
33+
__ep; \
3534
}))
3635
#else
3736
#define errno (*__errno_location())

libc/fmt/divmod10.internal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#define COSMOPOLITAN_LIBC_FMT_DIVMOD10_H_
33

44
forceinline uint64_t __divmod10(uint64_t __x, unsigned *__r) {
5-
#if defined(__STRICT_ANSI__) || !defined(__GNUC__) || \
6-
(defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__))
5+
#if !defined(__GNUC__) || (defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__))
76
*__r = __x % 10;
87
return __x / 10;
98
#else

0 commit comments

Comments
 (0)