Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSvBd-009Mt4-36 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 10:43:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSvBc-004BpJ-1V for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 10:43:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSvBc-004BpA-0U for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 10:43:16 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vSvBa-0041XG-0k for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 10:43:16 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-37d13ddaa6aso35527761fa.1 for ; Tue, 09 Dec 2025 02:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeltef.nl; s=google; t=1765276993; x=1765881793; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=A4FsrcLxZpOcq/lJOgwwNB3vJeY45cxGUO5wRjpYq+g=; b=Ff53aZL3nQScJkgXJDUsYr++4uDGuCS5AZLzPt1pvotxs8o6fhLfdSmLYZ3hMDK2X5 768ppq5GMY2dHOdOe4Ti+JAg9oroLpW0/bt+SErnfMNqVd5X6iDSfhG35z1mVdfmJ/SS JYwA3myQJpZUbpbjNV8anihfro+BRUs35XGoupAHITcFUbrpR8DansARUYMxBTPCkRFI tSyUA50PQIt1/vmfDmjnbprMUhiBV3FpshdjgxgbkLZW8bqMCrie4KOSB63r+ZibtPIB lX8R+jWfarSV+tbPR2SzQKpmVTjIr9UPsXYdja1hw4+CWKJSWDplo5OfdXE4YlydS1DL teeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765276993; x=1765881793; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=A4FsrcLxZpOcq/lJOgwwNB3vJeY45cxGUO5wRjpYq+g=; b=WenIWxYTCS85ezyCoGWLjUetb6v4I0CrNvK/SymENnoUwAgEZdSj3OBtoZRAg9PKhn b/00/zNRI+9LAt/wZxqFaLqyfJ5BRt+Nh5D7MlNlun+vQmhMjb1WrtxP4Nr7bLavXbT2 4vteUMnCvIfR/dstFSC9ok4jiTYFxWQrJWFTd1tdZ0NqVJItHa9jiXaL9f9vmFra/2Ws 266j/1PMYm8G+TuH+dwFsja2zVlsmnNl0Rk+H5o10qBv1ApJuqztaseVCoUDhi7Cb7RT EvOg0XZOToFxFEL2L7tSK9YgBfJ/6QkAaIwBjWnjQv6cGCuytxpAVMBNC1LUL2Xk+R6Z 5Dlg== X-Forwarded-Encrypted: i=1; AJvYcCWW8+1yxhGBmi+4Y3vZ2yWf2EJlQmAxMpy/ZTwtapNq/ZMeklVmVdQgOtwyTzeEm9IcayTMzAWIb07hf2bj@lists.postgresql.org X-Gm-Message-State: AOJu0Yyy6LyPSuE4EgPSAElRMz9cydNGMMPlzZG+zzILrRSw3xXHYMm3 zFOKXCJ3Y7xTTmopPFIP7R9SjNe6ObIzmwyuUSGWPIhZvFl/BBx7SdVoNELrE3DrewMr5XlMHGw Ol037g3crPFaA6xAAT5DWPs1s6DPFxkDfcBADyuxj+A== X-Gm-Gg: ASbGncs50J5fF5OC3xruvmNlCizd312XYT1r+fHM8h+Bqsq5YpE+cbkWqoki55c+RRq AUOmxlWpPtB4NsXZIPK6K8fwC4bkuPz1HqvKXoeDZdLtrm40OjqGaGUrjL8MuI+zEsrVqzxox7d pxe4DgOlLESLdVsmoRBgslAz28Ffyso/jYnOkBzh03aDjoKupSU11VDsPprge4GTNLrVZxq5ox6 QkUz9vCcjoLFj1ZyUtsqz7gzaxsUum71GEFEBGX5yV+O4FY+HLFOirqrf1JG+fm0wgZ2Q== X-Google-Smtp-Source: AGHT+IEEeuMD0jCGvCyytdlSdIdUZx5uk1eIh9ueHiHuCTrjunc4bq/bCVY2zRoM1OkM+tlDpn0n0QIyHZikOnFTJrc= X-Received: by 2002:ac2:4e11:0:b0:595:7a6b:91ff with SMTP id 2adb3069b0e04-5987e8c3f01mr3563610e87.19.1765276992803; Tue, 09 Dec 2025 02:43:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jelte Fennema-Nio Date: Tue, 9 Dec 2025 11:43:01 +0100 X-Gm-Features: AQt7F2qcIYO_4RE0fmdt21cUHSTRcWmxWKA0omC71H-S_pzhUZHz9r5ktHILHms Message-ID: Subject: Re: Safer hash table initialization macro To: Thomas Munro Cc: Bertrand Drouvot , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 9 Dec 2025 at 10:11, Thomas Munro wrote: > > What about relying on the existing __builtin_types_compatible_p() instead of > > _Generic() here? > > If we used standard C/C++ it'd work on MSVC too. And to be clear, that's important because the result of pg_expr_has_type_p fundamentally impacts the meaning of the code (i.e. it determines the hash function). Our existing usage of __builtin_types_compatible_p only adds some *optional* type checking, so for that it's not critical that it works on MSVC too.