Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKSuN-0003UD-78 for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Aug 2022 23:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oKSuL-0005De-5J for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Aug 2022 23:08:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKSuK-0005DV-Ru for pgsql-hackers@lists.postgresql.org; Sat, 06 Aug 2022 23:08:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKSuF-00010k-Cs for pgsql-hackers@postgresql.org; Sat, 06 Aug 2022 23:08:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 276N8RI2148624; Sat, 6 Aug 2022 19:08:27 -0400 From: Tom Lane To: Andres Freund cc: Thomas Munro , Andrew Dunstan , Robert Haas , pgsql-hackers Subject: Re: Cleaning up historical portability baggage In-reply-to: <20220806000311.ywx65iuchvj4qn2k@awork3.anarazel.de> References: <1249825.1658622186@sss.pgh.pa.us> <20220804013546.h65najrzig764jar@awork3.anarazel.de> <3295936.1659577924@sss.pgh.pa.us> <20220804023010.24snkyq3hser5pxq@awork3.anarazel.de> <20220805210823.u546w4p4wzfany7p@awork3.anarazel.de> <20220806000311.ywx65iuchvj4qn2k@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 05 Aug 2022 17:03:11 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <148622.1659827307.1@sss.pgh.pa.us> Date: Sat, 06 Aug 2022 19:08:27 -0400 Message-ID: <148623.1659827307@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > Thanks. Next in my quest for reducing autoconf vs meson pg_config.h > differences is GETTIMEOFDAY stuff. I just noticed that this could be simplified: #ifdef _MSC_VER struct timezone; /* Last parameter not used */ extern int gettimeofday(struct timeval *tp, struct timezone *tzp); #endif because what POSIX actually says is int gettimeofday(struct timeval *restrict tp, void *restrict tzp); and If tzp is not a null pointer, the behavior is unspecified. Indeed, we never call it with anything but a null tzp value, nor does our Windows fallback implementation do anything with tzp. So ISTM we should drop the bogus "struct timezone;" and declare this parameter as "void *tzp". regards, tom lane