From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5A741491FF for ; Mon, 5 Feb 2024 20:11:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D746168D13E; Mon, 5 Feb 2024 22:11:34 +0200 (EET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BAB268BED3 for ; Mon, 5 Feb 2024 22:11:28 +0200 (EET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1d93f2c3701so25157125ad.3 for ; Mon, 05 Feb 2024 12:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707163886; x=1707768686; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4dVhx5mJW51Yr9rNQCCV+CoSCPLGq9xeYos8de2hUQY=; b=WMA2J2iTTtKtcP+d5mIOJZ11sTPxccRgL1ezCUTVlhHqNRGDw1wcQsUls6x4VGeXaT Gk+HJxvyqH+Eph+kULKV/b2+0A66/VyjXenHTc5V7XYYTrQtuzWh/ckst0RtKtTEZ01b SkdiYJRqrvB67VKi3nL22Yq88XLOgFctN+VXEcC7SuaAy3A/PleDy4Rtfyjs3AszLcxH UqiNnTzvmebIQ3VWa8L8FRl1KL60VkPFwPiMcm/k+m6F/wnssKHBXO1Go5MW+qvZmzkx 39M197rtmYrzsmUHXlTr4KBR8f7uzZH5Lc1OJ5ybDCFsEj+v/0+Ke8U7ahFdEbSbCqzI AeMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707163886; x=1707768686; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4dVhx5mJW51Yr9rNQCCV+CoSCPLGq9xeYos8de2hUQY=; b=JHjUl/rYuxBICyZ4UbyY1Y+opsgdGvz9BvvfxfubQfARg2LHreVFet0CftRZ9rJ2MS ylrj3gpA1R0NDgbwGIfnhhY5J/gpkNBbLCn5sWlpQodikrWpsC8YsUoyEHAc8OoQkMwA RyAH6fkhTbEP2/e5yrKgm9xKFcdPxlAnMNnw6OiM75Wg4zW9dYqZ8/WaHGV/OJQ7wyR3 4qwhybCZhePTghm1FwnIVCFTmN69nUyrGROmwqQSqYZH2/ln47R5lNPg3oRtorXFmm2H On5QMHTI7fZTkh2VxOqhPjg4U5x1k8y0VoJkhyWcu2bHV3TcYQSJZ7b35GfM5aqyNOMd g/DA== X-Gm-Message-State: AOJu0YwtQmZ+NXYWTevC7uhoBahmbe56JOJuMMcOJpuCNTyi2ogX4Wc2 0FoLH/KRQZ/2DEWQJc9ub6zC3aBmnHatDTFIEjDU7CouesPZLxcJBVzKvSi+ X-Google-Smtp-Source: AGHT+IHQhZhzfYhoSr7zmG4duDWfj7xn9/akQIhbtuMPMSqZ4QkFo83CNnr8Sc/l8HQCnd85Nw9x+Q== X-Received: by 2002:a17:902:c20a:b0:1d9:8ac8:d77b with SMTP id 10-20020a170902c20a00b001d98ac8d77bmr187448pll.17.1707163885964; Mon, 05 Feb 2024 12:11:25 -0800 (PST) Received: from [192.168.0.18] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id u5-20020a170902b28500b001d944b3c5f1sm263835plr.178.2024.02.05.12.11.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 12:11:25 -0800 (PST) Message-ID: <23253a88-26fb-48bc-9b33-640a7e5e4f05@gmail.com> Date: Mon, 5 Feb 2024 17:12:00 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20240205195802.14522-1-anton@khirnov.net> <20240205195802.14522-2-anton@khirnov.net> From: James Almer Autocrypt: addr=jamrial@gmail.com; keydata= xsBNBFjZtqABCADLW+vdEoZaJZDsIO6geYFTOcn1unsEHefj9zn+3oTHlDFFzO47mzHsSfbK 9JE2xpOJEVnC8FAF5Sayi/pVwV+mtQUV3n5dgVeVBYF9GUQwOGFCpK8X54RRqhkgknbunOEE 0CtgAJgmpFmmmHgq02GvEspx1h/rh4apqwQR6QX4Favb+x9+i9ytVpwVcBX94vo2toyP7h/K BWfadQmb8ltgE1kshfg+SQs/H5bTV5Z1DuEASf02ZL/1qYB/sdTgWPLv9XMUHHsRFmMY8TMx wJSkP+Af3AiYQPJYz1B1D4tt98T/NoiVdin10zATakPjV8hXaobuRmxgakkUASXudydDABEB AAHNH0phbWVzIEFsbWVyIDxqYW1yaWFsQGdtYWlsLmNvbT7CwJIEEwEIADwCGwMGCwkIBwMC BhUIAgkKCwQWAgMBAh4BAheAFiEEd1EujP2UoWlX5pp6FGMBrXN2WeAFAmJoLUUCGQEACgkQ FGMBrXN2WeAFVQf9GtGhniRs1PzNUOgJktCnv6j4BbLieaIPYPEFXKDHOgjqQE2zVMYXnoXl Jam928ii902a8OY06r9ywn/R8ApD1/3NY/v64O71CY9scz5XyH2au8wIZ6HwFy3/f7sqjdGD uctY8Qs7rjT7NkoC5lmgMu2v2k03dGtM9AAf5AK5gU+H0EUw7vmKKiXzUqt5kvBuf4CEwXvH AQT1SMJ52rIlDWB7FQFyZeUbOAK2IgY/KNedfK6nsgd/eQVnlofPd2XoddE7kP6iys7jJefw DD3g3rZyDTq7in5dyk5glaNpWZpbHGBs+9SCYLnfQ8XvWqPFOD+gj0plamKANgOvavKTxM7A TQRY2bagAQgA69YtILj8kYxmqPr/M8+MXT7wVoOWVW9lvSmPquCELaDy/NIS7D06VC5EuE/6 JlJXZMTn37NLlyWhzwOgXuXw5w2tyoQQBuvqGiXJijuXwXH7HKdzrc6rpYtAqt5w05hzNrFS KrS0izG64VpWrfproy3BsL+8TBm9brLhhNPynVRqVukbbGzlATTzNQGZ14TTi2/dL6DkMQnM qn4jX9UEe4GdGQBP50bUJSSmeiIkyNLWA+znuN2PZEz930ZwNrF9GtDVw7mzcmpCZ7spldE2 tutbpy9D1bIqxyqBrYDSezyzL2adR1qgHyOTMCHg2AYNkrIQHrSyJxKTpZ1/hqOp8wARAQAB wsBfBBgBAgAJBQJY2bagAhsMAAoJEBRjAa1zdlnghekH/0Yb0iYJ74oID2f/Fj+AJKS2ekQF P2xOr8lpGzgp/+yWUvPtqbX0A33anBJdYwxaAC0NataX3tfZ+oJkzXqfmqhIHMPYHdZesJA2 Bk9hU/33mDl5s5U66/z0uelWzwKVHoQ2O6or4+qF3HJFSJLCe9uvWJ3zXf9F342Ftj73sfx+ 3xkw/IXsN1RqbYqDlzpoEQ99SIEfY/8Jjwnd3sIPfqkuyeaYfe6GJDqKawdCEP1oRRlbXEAp TJgYz8r3nPhGv9cdHNDCk44ISbsqVuxIEnLqi4fTPZaGupiQhT+srl268TTAp2TQW7+6Ce/b NPQorMquzS/LZoyALpmsYi/miMc= In-Reply-To: <20240205195802.14522-2-anton@khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 2/2] Require compilers to support C17. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2/5/2024 4:54 PM, Anton Khirnov wrote: > It should be available in all relevant modern compilers and will allow > us to use features like anonymous unions. > > Note that stdatomic.h is still emulated on MSVC, as current versions > require the /experimental:c11atomics, and do not support > ATOMIC_VAR_INIT() anyway. > --- > Now moving to C17 rather than C11, as the former contains important > fixes and its support across the compilers we care about should be > similar. > > Now also tested with MSVC in wine, thanks to Martin for pointing me at > https://github.com/mstorsjo/msvc-wine > --- > configure | 23 +++++++++++------------ > doc/developer.texi | 10 ++-------- > 2 files changed, 13 insertions(+), 20 deletions(-) > > diff --git a/configure b/configure > index f72533b7d2..1bb9e23f19 100755 > --- a/configure > +++ b/configure > @@ -4705,7 +4705,7 @@ msvc_common_flags(){ > # generic catch all at the bottom will print the original flag. > -Wall) ;; > -Wextra) ;; > - -std=c*) ;; > + -std=c*) echo /std:${flag#-std=};; > # Common flags > -fomit-frame-pointer) ;; > -g) echo -Z7 ;; > @@ -4750,7 +4750,7 @@ icl_flags(){ > # Despite what Intel's documentation says -Wall, which is supported > # on Windows, does enable remarks so disable them here. > -Wall) echo $flag -Qdiag-disable:remark ;; > - -std=c99) echo -Qstd=c99 ;; > + -std=c17) echo -Qstd=c17 ;; > -flto*) echo -ipo ;; > esac > done > @@ -4798,7 +4798,7 @@ suncc_flags(){ > athlon*) echo -xarch=pentium_proa ;; > esac > ;; > - -std=c99) echo -xc99 ;; > + -std=c17) echo -xc17 ;; Does SunCC support this? Does anyone use SunCC at all? > -fomit-frame-pointer) echo -xregs=frameptr ;; > -fPIC) echo -KPIC -xcode=pic32 ;; > -W*,*) echo $flag ;; > @@ -4887,8 +4887,8 @@ probe_cc(){ > _type=suncc > _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) > _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' > - _DEPFLAGS='-xM1 -xc99' > - _ldflags='-std=c99' > + _DEPFLAGS='-xM1 -xc17' > + _ldflags='-std=c17' > _cflags_speed='-O5' > _cflags_size='-O5 -xspace' > _flags_filter=suncc_flags > @@ -5517,21 +5517,20 @@ if test "$?" != 0; then > die "C compiler test failed." > fi > > -add_cppflags -D_ISOC99_SOURCE > +add_cppflags -D_ISOC11_SOURCE > add_cxxflags -D__STDC_CONSTANT_MACROS > check_cxxflags -std=c++11 || check_cxxflags -std=c++0x > > -# some compilers silently accept -std=c11, so we also need to check that the > +# some compilers silently accept -std=c17, so we also need to check that the > # version macro is defined properly > -test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" && > - add_cflags -std=c11 || > - check_cflags -std=c99 > +test_cflags_cc -std=c17 ctype.h "__STDC_VERSION__ >= 201710L" && > + add_cflags -std=c17 || die "Compiler lacks C17 support" > > check_cppflags -D_FILE_OFFSET_BITS=64 > check_cppflags -D_LARGEFILE_SOURCE > > -add_host_cppflags -D_ISOC99_SOURCE > -check_host_cflags -std=c99 > +add_host_cppflags -D_ISOC11_SOURCE > +check_host_cflags -std=c17 > check_host_cflags -Wall > check_host_cflags $host_cflags_speed > > diff --git a/doc/developer.texi b/doc/developer.texi > index eed0ee4915..6e9807aa06 100644 > --- a/doc/developer.texi > +++ b/doc/developer.texi > @@ -56,14 +56,8 @@ and should try to fix issues their commit causes. > > @section Language > > -FFmpeg is mainly programmed in the ISO C99 language, extended with: > -@itemize @bullet > -@item > -Atomic operations from C11 @file{stdatomic.h}. They are emulated on > -architectures/compilers that do not support them, so all FFmpeg-internal code > -may use atomics without any extra checks. However, @file{stdatomic.h} must not > -be included in public headers, so they stay C99-compatible. > -@end itemize > +FFmpeg is mainly programmed in the ISO C17 language, except for the public > +headers which must stay C99 compatible. > > Compiler-specific extensions may be used with good reason, but must not be > depended on, i.e. the code must still compile and work with compilers lacking _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".