Get repository to build with GCC 11

See #594
This commit is contained in:
Justine Tunney 2022-09-13 04:14:20 -07:00
parent 446a1f7c5a
commit 06f9a5b627
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
34 changed files with 115 additions and 51 deletions

View file

@ -16,6 +16,7 @@
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
#if defined(_MSC_VER) && !defined(__clang__)
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

View file

@ -55,8 +55,10 @@ template unsigned __sort5<__less<long double>&, long double*>(long double*, long
#ifndef _LIBCPP_HAS_NO_THREADS
_LIBCPP_SAFE_STATIC static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
#endif
unsigned __rs_default::__c_ = 0;
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
|| defined(_LIBCPP_BUILDING_LIBRARY)
unsigned __rs_default::__c_ = 0;
__rs_default::__rs_default()
{
#ifndef _LIBCPP_HAS_NO_THREADS
@ -64,12 +66,10 @@ __rs_default::__rs_default()
#endif
__c_ = 1;
}
__rs_default::__rs_default(const __rs_default&)
{
++__c_;
}
__rs_default::~__rs_default()
{
#ifndef _LIBCPP_HAS_NO_THREADS
@ -79,13 +79,13 @@ __rs_default::~__rs_default()
--__c_;
#endif
}
__rs_default::result_type
__rs_default::operator()()
{
static mt19937 __rs_g;
return __rs_g();
}
#endif
__rs_default
__rs_get()

View file

@ -14,23 +14,25 @@
namespace std {
_LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler;
_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
#if _LIBCPP_STD_VER <= 14 || \
defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
// libcxxrt provides implementations of these functions itself.
unexpected_handler set_unexpected(unexpected_handler func) _NOEXCEPT {
return __libcpp_atomic_exchange(&__unexpected_handler, func);
}
unexpected_handler get_unexpected() _NOEXCEPT {
return __libcpp_atomic_load(&__unexpected_handler);
}
_LIBCPP_NORETURN
void unexpected() {
(*get_unexpected())();
// unexpected handler should not return
terminate();
}
#endif
terminate_handler set_terminate(terminate_handler func) _NOEXCEPT {
return __libcpp_atomic_exchange(&__terminate_handler, func);

View file

@ -427,7 +427,9 @@ eval_makefile (const char *filename, unsigned short flags)
fclose (ebuf.fp);
free (ebuf.bufstart);
alloca (0);
/* [jart] breaks gcc11 (also wat) */
void *volatile wat = alloca (0);
errno = 0;
return deps;
@ -469,7 +471,8 @@ eval_buffer (char *buffer, const floc *flocp)
reading_file = curfile;
alloca (0);
/* [jart] breaks gcc11 (also wat) */
void *volatile wat = alloca (0);
}
/* Check LINE to see if it's a variable assignment or undefine.
@ -2495,7 +2498,8 @@ find_percent_cached (const char **string)
if (! new)
{
slen = strlen (*string);
new = alloca (slen + 1);
/* [jart] can't prove alloca() isn't returned; let's just leak */
new = malloc (slen + 1);
memcpy (new, *string, slen + 1);
p = new + (p - *string);
*string = new;

View file

@ -322,7 +322,7 @@ update_file (struct file *file, unsigned int depth)
check_renamed (f);
/* Clean up any alloca() used during the update. */
alloca (0);
void *volatile wat = alloca (0);
/* If we got an error, don't bother with double_colon etc. */
if (new && !keep_going_flag)

View file

@ -29,7 +29,7 @@
* @note words are host endian while array is little endian
* @mayalias
*/
void (*Mul4x4)(uint64_t C[8], const uint64_t A[4], const uint64_t B[4]);
void (*Mul4x4)(uint64_t C[16], const uint64_t A[8], const uint64_t B[8]);
static textstartup void Mul4x4Init()
{
@ -38,7 +38,7 @@ static textstartup void Mul4x4Init()
const void *const Mul4x4Ctor[] initarray = {Mul4x4Init};
void Mul4x4Pure(uint64_t C[8], const uint64_t A[4], const uint64_t B[4])
void Mul4x4Pure(uint64_t C[16], const uint64_t A[8], const uint64_t B[8])
{
uint128_t t;
uint64_t h, c1, c2, c3;

View file

@ -2699,7 +2699,7 @@ void test_ssl_message_queue_insufficient_buffer_wrapper( void ** params )
void test_ssl_message_mock_uninitialized( )
{
enum { MSGLEN = 10 };
unsigned char message[MSGLEN], received[MSGLEN];
unsigned char message[MSGLEN] = {0}, received[MSGLEN];
mbedtls_mock_socket client, server;
mbedtls_test_message_queue server_queue, client_queue;
mbedtls_test_message_socket_context server_context, client_context;

View file

@ -38,6 +38,10 @@
#include "third_party/python/Modules/_decimal/libmpdec/typearith.h"
/* clang-format off */
#if __GNUC__ >= 11
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
asm(".ident\t\"\\n\\n\
libmpdec (BSD-2)\\n\
Copyright 2008-2016 Stefan Krah\"");

View file

@ -90,7 +90,7 @@ NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
# define ENCODING_MAX 128
char buf[ENCODING_MAX];
char buf[ENCODING_MAX] = {0}; /* [jart] wut */
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);

View file

@ -24,6 +24,10 @@
*/
#include "third_party/sqlite3/sqliteInt.inc"
#if __GNUC__ >= 11
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
/* clang-format off */
#ifndef SQLITE_OMIT_SHARED_CACHE
@ -4230,7 +4234,7 @@ void sqlite3DefaultRowEst(Index *pIdx){
if( x<99 ){
pIdx->pTable->nRowLogEst = x = 99;
}
if( pIdx->pPartIdxWhere!=0 ) x -= 10; assert( 10==sqlite3LogEst(2) );
if( pIdx->pPartIdxWhere!=0 ) x -= 10; /*assert( 10==sqlite3LogEst(2) );*/
a[0] = x;
/* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is

View file

@ -14170,10 +14170,13 @@ static int sqlite3Fts5IndexQuery(
/* If the QUERY_SCAN flag is set, all other flags must be clear. */
assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN );
/* [jart] what is with these gcc11 warnings */
void *MemCpy(void *, const void *, size_t) asm("memcpy");
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
int iIdx = 0; /* Index to search */
int iPrefixIdx = 0; /* +1 prefix index */
if( nToken ) memcpy(&buf.p[1], pToken, nToken);
if( nToken ) MemCpy(&buf.p[1], pToken, nToken);
/* Figure out which index to search and set iIdx accordingly. If this
** is a prefix query for which there is no prefix index, set iIdx to

View file

@ -20,6 +20,10 @@
#include "third_party/sqlite3/whereInt.inc"
/* clang-format off */
#if __GNUC__ >= 11
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
/*
** Extra information appended to the end of sqlite3_index_info but not
** visible to the xBestIndex function, at least not directly. The

View file

@ -891,7 +891,7 @@ static Bool CompareColors( const int rgbBG[3], const int rgbFG[3] )
* blue = 5.
*********************************************************************/
static Bool GetRgb( ctmbstr color, int rgb[] )
static Bool GetRgb( ctmbstr color, int rgb[3] )
{
uint x;

View file

@ -14,6 +14,10 @@
#include "libc/fmt/fmt.h"
#include "third_party/tidy/utf8.h"
#if __GNUC__ >= 11 /* [jart] this one looks legit */
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
/*
Bind attribute types to procedures to check values.
You can add new procedures for better validation

View file

@ -75,6 +75,10 @@
#include "third_party/unzip/unzvers.h"
#include "third_party/unzip/globals.h"
#if __GNUC__ >= 11 /* [jart] worth looking into */
#pragma GCC diagnostic ignored "-Wrestrict"
#endif
#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */
/***************************/

View file

@ -59,6 +59,10 @@ $(THIRD_PARTY_UNZIP_A_OBJS): private \
-DHAVE_TERMIOS_H \
-DNO_LCHMOD
$(THIRD_PARTY_UNZIP_A_OBJS): private \
OVERRIDE_CFLAGS += \
$(OLD_CODE)
THIRD_PARTY_UNZIP_COMS = o/$(MODE)/third_party/unzip/unzip.com
THIRD_PARTY_UNZIP_BINS = $(THIRD_PARTY_UNZIP_COMS) $(THIRD_PARTY_UNZIP_COMS:%=%.dbg)
THIRD_PARTY_UNZIP_LIBS = $(foreach x,$(THIRD_PARTY_UNZIP_ARTIFACTS),$($(x)))