mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Restore strict header checking
This commit is contained in:
parent
b212f49ef4
commit
ad775a75b8
16 changed files with 43 additions and 41 deletions
11
Makefile
11
Makefile
|
@ -377,6 +377,17 @@ $(SRCS): \
|
|||
libc/integral/lp64arg.inc \
|
||||
libc/integral/lp64.inc
|
||||
|
||||
o/%.h.ok: %.h $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.h.ok: %.h $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.hh.ok: %.hh $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/%.okk: % $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/$(MODE)/%.okk: % $(HDRS) $(INCS)
|
||||
@$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
||||
# UNSPECIFIED PREREQUISITES TUTORIAL
|
||||
#
|
||||
# A build rule must exist for all files that make needs to consider in
|
||||
|
|
|
@ -99,21 +99,3 @@ o/$(MODE)/%.lua.runs: %.lua o/$(MODE)/tool/net/redbean.com
|
|||
o/$(MODE)/%: o/$(MODE)/%.com o/$(MODE)/tool/build/cp.com o/$(MODE)/tool/build/assimilate.com
|
||||
@$(COMPILE) -wACP -T$@ o/$(MODE)/tool/build/cp.com $< $@
|
||||
@$(COMPILE) -wAASSIMILATE -T$@ o/$(MODE)/tool/build/assimilate.com $@
|
||||
|
||||
# TODO(jart): find a way to generate dependencies
|
||||
# or alternatively disable sandboxing
|
||||
o/%.h.ok: %.h
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.h.ok: %.h
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.hh.ok: %.hh
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/%.okk: %
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/$(MODE)/%.okk: %
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
#ifndef LIBC_ISYSTEM_TGMATH_H_
|
||||
#define LIBC_ISYSTEM_TGMATH_H_
|
||||
|
||||
#include "libc/complex.h"
|
||||
#include "libc/math.h"
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
#if __STDC_VERSION__ + 0 >= 201112
|
||||
COSMOPOLITAN_C_START_
|
||||
|
@ -306,12 +304,14 @@ COSMOPOLITAN_C_START_
|
|||
: conj, complex long double \
|
||||
: conjl)(x)
|
||||
|
||||
#undef creal
|
||||
#define creal(x) \
|
||||
_Generic((x), complex float \
|
||||
: crealf, complex default \
|
||||
: creal, complex long double \
|
||||
: creall)(x)
|
||||
|
||||
#undef cimag
|
||||
#define cimag(x) \
|
||||
_Generic((x), complex float \
|
||||
: cimagf, complex default \
|
||||
|
@ -328,5 +328,4 @@ COSMOPOLITAN_C_END_
|
|||
|
||||
#endif /* C11 */
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#endif
|
||||
#endif /* LIBC_ISYSTEM_TGMATH_H_ */
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_WINTERNL_H_
|
||||
#define COSMOPOLITAN_LIBC_ISYSTEM_WINTERNL_H_
|
||||
#include <Windows.h>
|
||||
|
||||
#include "libc/nt/struct/ldr.h"
|
||||
#include "libc/nt/ntdll.h"
|
||||
#include "libc/nt/struct/ldr.h"
|
||||
#include "libc/nt/struct/peb.h"
|
||||
#include "libc/nt/struct/teb.h"
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_WINTERNL_H_ */
|
||||
|
|
|
@ -15,8 +15,6 @@ COSMOPOLITAN_C_START_
|
|||
#define ntohl(u32) bswap_32(u32)
|
||||
|
||||
#define IFHWADDRLEN 6
|
||||
#define IF_NAMESIZE 16
|
||||
#define IFNAMSIZ IF_NAMESIZE
|
||||
|
||||
const char *inet_ntop(int, const void *, char *, uint32_t);
|
||||
int inet_pton(int, const char *, void *);
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define IF_NAMESIZE 16
|
||||
#define IFNAMSIZ IF_NAMESIZE
|
||||
|
||||
struct ifreq {
|
||||
union {
|
||||
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_MSGHDR_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_MSGHDR_INTERNAL_H_
|
||||
#include "libc/sock/struct/msghdr.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
3
third_party/libcxx/__bsd_locale_fallbacks.h
vendored
3
third_party/libcxx/__bsd_locale_fallbacks.h
vendored
|
@ -16,7 +16,10 @@
|
|||
#include "third_party/libcxx/stdlib.h"
|
||||
#include "libc/mem/fmt.h"
|
||||
#include "libc/str/unicode.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/locale.h"
|
||||
#include "third_party/libcxx/memory"
|
||||
#include "third_party/libcxx/__locale"
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
|
|
1
third_party/libcxx/__config
vendored
1
third_party/libcxx/__config
vendored
|
@ -1152,6 +1152,7 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
|
|||
!defined(_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP)) \
|
||||
|| defined(_LIBCPP_HAS_NO_THREADS)
|
||||
# define _LIBCPP_HAS_NO_ATOMIC_HEADER
|
||||
# define _LIBCPP_ATOMIC_FLAG_TYPE bool
|
||||
#else
|
||||
# ifndef _LIBCPP_ATOMIC_FLAG_TYPE
|
||||
# define _LIBCPP_ATOMIC_FLAG_TYPE bool
|
||||
|
|
10
third_party/libcxx/atomic
vendored
10
third_party/libcxx/atomic
vendored
|
@ -21,16 +21,6 @@
|
|||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_THREADS
|
||||
# error <atomic> is not supported on this single threaded system
|
||||
#endif
|
||||
#ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER
|
||||
# error <atomic> is not implemented
|
||||
#endif
|
||||
#ifdef kill_dependency
|
||||
# error C++ standard library is incompatible with <stdatomic.h>
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
|
||||
_LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
|
||||
__m == memory_order_acquire || \
|
||||
|
|
1
third_party/libcxx/clocale
vendored
1
third_party/libcxx/clocale
vendored
|
@ -36,6 +36,7 @@ lconv* localeconv();
|
|||
*/
|
||||
|
||||
#include "third_party/libcxx/__config"
|
||||
#include "libc/str/unicode.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
|
7
third_party/libcxx/cwchar
vendored
7
third_party/libcxx/cwchar
vendored
|
@ -13,6 +13,13 @@
|
|||
#include "third_party/libcxx/__config"
|
||||
#include "third_party/libcxx/cwctype"
|
||||
#include "third_party/libcxx/wchar.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "third_party/gdtoa/gdtoa.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
|
4
third_party/libcxx/thread
vendored
4
third_party/libcxx/thread
vendored
|
@ -34,9 +34,7 @@
|
|||
_LIBCPP_PUSH_MACROS
|
||||
#include "third_party/libcxx/__undef_macros"
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_THREADS
|
||||
#error <thread> is not supported on this single threaded system
|
||||
#else // !_LIBCPP_HAS_NO_THREADS
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
|
|
2
third_party/mbedtls/mbedtls.mk
vendored
2
third_party/mbedtls/mbedtls.mk
vendored
|
@ -7,6 +7,7 @@ THIRD_PARTY_MBEDTLS_ARTIFACTS += THIRD_PARTY_MBEDTLS_A
|
|||
THIRD_PARTY_MBEDTLS = $(THIRD_PARTY_MBEDTLS_A_DEPS) $(THIRD_PARTY_MBEDTLS_A)
|
||||
THIRD_PARTY_MBEDTLS_A = o/$(MODE)/third_party/mbedtls/mbedtls.a
|
||||
THIRD_PARTY_MBEDTLS_A_FILES := $(wildcard third_party/mbedtls/*)
|
||||
THIRD_PARTY_MBEDTLS_A_INCS = $(filter %.inc,$(THIRD_PARTY_MBEDTLS_A_FILES))
|
||||
THIRD_PARTY_MBEDTLS_A_HDRS = $(filter %.h,$(THIRD_PARTY_MBEDTLS_A_FILES))
|
||||
THIRD_PARTY_MBEDTLS_A_SRCS = $(filter %.c,$(THIRD_PARTY_MBEDTLS_A_FILES))
|
||||
THIRD_PARTY_MBEDTLS_A_OBJS = $(THIRD_PARTY_MBEDTLS_A_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
@ -78,6 +79,7 @@ o/$(MODE)/third_party/mbedtls/zeroize.o: private \
|
|||
THIRD_PARTY_MBEDTLS_LIBS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)))
|
||||
THIRD_PARTY_MBEDTLS_SRCS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_SRCS))
|
||||
THIRD_PARTY_MBEDTLS_HDRS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_HDRS))
|
||||
THIRD_PARTY_MBEDTLS_INCS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_INCS))
|
||||
THIRD_PARTY_MBEDTLS_CHECKS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_CHECKS))
|
||||
THIRD_PARTY_MBEDTLS_OBJS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_OBJS))
|
||||
$(THIRD_PARTY_MBEDTLS_A_OBJS): third_party/mbedtls/mbedtls.mk
|
||||
|
|
1
third_party/python/Modules/socketmodule.h
vendored
1
third_party/python/Modules/socketmodule.h
vendored
|
@ -1,6 +1,7 @@
|
|||
#ifndef Py__SOCKET_H
|
||||
#define Py__SOCKET_H
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#include "third_party/python/Include/object.h"
|
||||
#include "third_party/python/Include/pytime.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
|
8
third_party/quickjs/quickjs.mk
vendored
8
third_party/quickjs/quickjs.mk
vendored
|
@ -8,6 +8,7 @@ THIRD_PARTY_QUICKJS_BINS = $(THIRD_PARTY_QUICKJS_COMS) $(THIRD_PARTY_QUICKJS_COM
|
|||
THIRD_PARTY_QUICKJS = $(THIRD_PARTY_QUICKJS_A_DEPS) $(THIRD_PARTY_QUICKJS_A)
|
||||
THIRD_PARTY_QUICKJS_A = o/$(MODE)/third_party/quickjs/quickjs.a
|
||||
THIRD_PARTY_QUICKJS_HDRS = $(foreach x,$(THIRD_PARTY_QUICKJS_ARTIFACTS),$($(x)_HDRS))
|
||||
THIRD_PARTY_QUICKJS_INCS = $(foreach x,$(THIRD_PARTY_QUICKJS_ARTIFACTS),$($(x)_INCS))
|
||||
|
||||
THIRD_PARTY_QUICKJS_A_SRCS = \
|
||||
third_party/quickjs/array.c \
|
||||
|
@ -66,6 +67,13 @@ THIRD_PARTY_QUICKJS_A_HDRS = \
|
|||
third_party/quickjs/quickjs-libc.h \
|
||||
third_party/quickjs/quickjs.h
|
||||
|
||||
THIRD_PARTY_QUICKJS_A_INCS = \
|
||||
third_party/quickjs/libregexp-opcode.inc \
|
||||
third_party/quickjs/libunicode-table.inc \
|
||||
third_party/quickjs/quickjs-atom.inc \
|
||||
third_party/quickjs/quickjs-opcode.inc \
|
||||
third_party/quickjs/unicode_gen_def.inc
|
||||
|
||||
THIRD_PARTY_QUICKJS_A_OBJS = \
|
||||
$(THIRD_PARTY_QUICKJS_A_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
|
|
Loading…
Reference in a new issue