From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by sourceware.org (Postfix) with ESMTPS id 1E6973858C83 for ; Mon, 24 Apr 2023 00:55:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E6973858C83 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-3ef31924c64so1412501cf.1 for ; Sun, 23 Apr 2023 17:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682297713; x=1684889713; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=KmvBt8/1EKyInj5xMRHb/ISjVPnxJ7kBzteQ4+BDqss=; b=MhA6pD3fcU8XUTCGbgmHDGKyFNM+1gOMC2ENpGNoE0f8ja/v3/KDR+bWYBsSk/JVCg dyIRoviM4jUvWJpZbJxkP1pLVALX03KGIjK5VofovL8gs+MCa0l7+ekqjAbN34X/onpN EEmi1ehkBfJ/HOFkrGNu/zP1D11ywAzSVFBzx6up73DkAUfu3n5Difkpdt/kAL7D/Bp8 NaPrRpMs+CZ0KcJT0B5ob4U6KBJKiatY5KQrP+NdFo06vAv24ulSJRfehtDsifTwTURK IfRDDKr2lc2hQcGzMu2puD81R0kGhZkk+rfrZpszNLFPw0wjzS7HJEr59MuvB6fP9WpK kJgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682297713; x=1684889713; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KmvBt8/1EKyInj5xMRHb/ISjVPnxJ7kBzteQ4+BDqss=; b=lalMSG67O9PB39JJbK1fgSvGCcvp4ZgklG+TQzwl2S5C754exFT7H2CLfd3OMgZocQ 4aPWYlTGGA61kgu+pXhsUTK0UgSFSkiQ/K4lgyIcWzgLoy10KwSR5nWNWkhPi7cPIMJQ MlvUncYaeCo3O6/Ly0O5iHIky+fACNCojYOQBmWbh0ryBPd/r+3nydpEFUXsgyghPGFJ u1NnkwJdHcbv083taTcf20BFiSj3hLnAJfiETHMn0D0rwRrj44uPULRFaaHeWPVNmuYE r+w/AnlZFSIdJ9M4gzEAGRUJ2JnaZESxjEv1/aXfYSO7+s7kjcyUwUD0zAdb+WrUx62B FZAA== X-Gm-Message-State: AAQBX9csdU8wtjEhs3mfadtUeisrg+zKBKVg8OR68YxicH2RwOBPr7BL Ip/scnNxUkfQyJygXojf3T8h8N2Cf5KHwpDfb2rtJFPbIMBUQpd/JpA= X-Google-Smtp-Source: AKy350aL2Az2+sYaOqn1+SSoysNZXrLlolBXKrCRrg+rgaB5LM++KM5DDlF+lRliS8CMWvHlx7oEOGLt5UjeIF4boxA= X-Received: by 2002:a05:622a:1998:b0:3ef:26ec:f27a with SMTP id u24-20020a05622a199800b003ef26ecf27amr367250qtc.13.1682297713379; Sun, 23 Apr 2023 17:55:13 -0700 (PDT) MIME-Version: 1.0 From: Roland McGrath Date: Sun, 23 Apr 2023 17:55:02 -0700 Message-ID: Subject: [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives To: Binutils , GDB Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-19.2 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The libc++ headers changed recently such that some standard C++ headers that didn't used to lead to using and its symbols now do so. This ran afoul of the shenanigans in "safe-ctype.h" in at least one place where that header is included before a standard header. This only broke things that I saw in gdb/minsyms.c, but the same problem may well arise in the future with other headers. This sort of redefinition of standard symbols is definitely not kosher under the C and C++ standards at all. In the long run we should consider ways to solve the problem "safe-ctype.h" exists to solve without violating the language standards in this way. To make the code more future-proof while we're still doing this, I changed all the uses uniformly throughout the repo to just put #include "safe-ctype.h" last, with a comment reminding folks not to change that ordering (and a comment in safe-ctype.h about that). I didn't touch anything in the libiberty subdirectory since AIUI that's still copied from the gcc repository. The changes are on the users/roland/safe-ctype branch on sourceware. My mailer makes it difficult to paste a large patch like this into the message without mangling it. It's very mechanical and I figure everyone actively concerned can look at the git branch on sourceware easily enough for themselves. OK for trunk? Thanks, Roland