From owner-svn-src-all@freebsd.org Tue Jun 27 05:02:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01B94DA0C4F; Tue, 27 Jun 2017 05:02:13 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D76C07B7BF; Tue, 27 Jun 2017 05:02:12 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 29CAB1F3DE; Tue, 27 Jun 2017 05:02:12 +0000 (UTC) From: Jan Beich To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320240 - head/include References: <201706221839.v5MIdqK3065947@repo.freebsd.org> Date: Tue, 27 Jun 2017 07:02:07 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 05:02:13 -0000 Ed Schouten writes: > Author: ed > Date: Thu Jun 22 18:39:52 2017 > New Revision: 320240 > URL: https://svnweb.freebsd.org/changeset/base/320240 > > Log: > Use __ISO_C_VISIBLE, as opposed to testing __STDC_VERSION__. > > FreeBSD's C library uses __STDC_VERSION__ to determine whether the > compiler provides language features specific to a certain version of the > C standard. __ISO_C_VISIBLE is used to specify which library features > need to be exposed. > > max_align_t currently uses __STDC_VERSION__, even though it should be > using __ISO_C_VISIBLE to remain consistent with the rest of the headers > in include/. > > Reviewed by: dim > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D11303 > > Modified: > head/include/stddef.h > > Modified: head/include/stddef.h > ============================================================================== > --- head/include/stddef.h Thu Jun 22 17:10:34 2017 (r320239) > +++ head/include/stddef.h Thu Jun 22 18:39:52 2017 (r320240) > @@ -62,7 +62,7 @@ typedef ___wchar_t wchar_t; > #endif > #endif > > -#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L > +#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L > #ifndef __CLANG_MAX_ALIGN_T_DEFINED > typedef __max_align_t max_align_t; > #define __CLANG_MAX_ALIGN_T_DEFINED max_align_t is now exposed even without -std=c11. #+begin_src c $ cat a.c #include /* * a type with the most strict alignment requirements */ union max_align { char c; short s; long l; int i; float f; double d; void * v; void (*q)(void); }; typedef union max_align max_align_t; int main(int argc, char *argv[]) { return 0; } $ cc -std=gnu89 a.c a.c:18:14: error: typedef redefinition with different types ('void' vs '__max_align_t') typedef void max_align_t; ^ /usr/include/stddef.h:67:23: note: previous definition is here typedef __max_align_t max_align_t; ^ 1 error generated. #+end_src c thus regressing some ports e.g., #+begin_src c cc -o Unified_c_media_libnestegg_src0.o -c ... -std=gnu99 ... Unified_c_media_libnestegg_src0.c In file included from obj-i386-unknown-freebsd12.0/media/libnestegg/src/Unified_c_media_libnestegg_src0.c:2: In file included from media/libnestegg/src/halloc.c:19: media/libnestegg/src/align.h:42:25: error: typedef redefinition with different types ('union max_align' vs '__max_align_t') typedef union max_align max_align_t; ^ /usr/include/stddef.h:67:23: note: previous definition is here typedef __max_align_t max_align_t; ^ 1 error generated. #+end_src c https://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20170626/493679.html