<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/glibc.git/assert/Makefile, branch master</title>
<subtitle>GNU C Library
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/glibc.git/atom?h=master</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/'/>
<updated>2026-03-02T17:24:17Z</updated>
<entry>
<title>assert: Support assert as variadic macro for C++26 [PR27276]</title>
<updated>2026-03-02T17:24:17Z</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2026-02-25T14:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=ea37298b65bd67f94c3c2640e91ec5865a5019ad'/>
<id>urn:sha1:ea37298b65bd67f94c3c2640e91ec5865a5019ad</id>
<content type='text'>
C++26 changes assert into a variadic macro to support using
assignment-expressions that would be interpreted as multiple macro
arguments, in particular one containing:
* template parameter lists: func&lt;int, float&gt;()
* calls to overloaded operator[] that accepts multiple arguments: arr[1, 2]
  this is C++23 feature, see libstdc++ PR/119855 [1]
* lambdas with explicit captures: [x, y] { ... }

The new expansion in form:
  (__VA_ARGS__) ? void (1 ? 1 : bool (__VA_ARGS__))
                : __assert_fail (...)
Has the following properties:
* Use of (__VA_ARGS__) ? ... : ..., requires that __VA_ARGS__
  is contextually convertible to bool. This means that enumerators
  of scoped enumeration are no longer accepted (they are only
  explicitly convertible). Thus this patch address the glibc PR/27276 [2].
* Nested ternary 1 ? 1 : bool (__VA_ARGS__) guarantees that
  expression expanded from __VA_ARGS__ is not evaluated twice.
  This is used instead of unevaluated context (like sizeof...)
  to support C++ expressions that are not allowed in unevaluated
  context (lambdas until C++20, co_await, co_yield).
* bool (__VA_ARGS__) is ill-formed if __VA_ARGS__ expands to
  multiple arguments: assert(1, 2)
* bool (__VA_ARGS__) also triggers warnings when __VA_ARGS__
  expands to x = 1: assert(x = 1)

To guarantee that the code snippets from assert/test-assert-c++-variadic.cc,
are actually checked for validity, we need to compile this test in C++26
(-std=c++26) mode. To achieve that, this patch compiles the file with
test-config-cxxflags-stdcxx26 variable as additional flag, that is set to
-std=c++26 if $(TEST_CXX) executable supports that flag, and empty otherwise.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119855
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=27276

Co-authored-by: Tomasz Kamiński &lt;tkaminsk@redhat.com&gt;
Signed-off-by: Tomasz Kamiński &lt;tkaminsk@redhat.com&gt;
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2026-01-01T21:42:29Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-01-01T17:32:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=66f3e9219d8f86b977d9be04ad469b5d72af0da2'/>
<id>urn:sha1:66f3e9219d8f86b977d9be04ad469b5d72af0da2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support assert as a variadic macro for C23</title>
<updated>2025-11-03T19:56:42Z</updated>
<author>
<name>Joseph Myers</name>
<email>josmyers@redhat.com</email>
</author>
<published>2025-11-03T19:56:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=fa7f43a9823efb5a24597ceca7863cca0b734c2d'/>
<id>urn:sha1:fa7f43a9823efb5a24597ceca7863cca0b734c2d</id>
<content type='text'>
C23 makes assert into a variadic macro to handle cases of an argument
that would be interpreted as a single function argument but more than
one macro argument (in particular, compound literals with an
unparenthesized comma in an initializer list); this change was made by
N2829.  Note that this only applies to assert, not to other macros
specified in the C standard with particular numbers of arguments.

Implement this support in glibc.  This change is only for C; C++ would
need a separate change to its separate assert implementations.  It's
also applied only in C23 mode.  It depends on support for (C99)
variadic macros, and also (in order to detect calls where more than
one expression is passed, via an unevaluated function call) a C99
boolean type.  These requirements are encapsulated in the definition
of __ASSERT_VARIADIC.  Tests with -std=c99 and -std=gnu99 (using
implementations continue to work.

I don't think we have a way in the glibc testsuite to validate that
passing more than one expression as an argument does produce the
desired error.

Tested for x86_64.
</content>
</entry>
<entry>
<title>assert: Add test for CVE-2025-0395</title>
<updated>2025-02-13T17:33:27Z</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@sourceware.org</email>
</author>
<published>2025-01-31T17:16:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=cdb9ba84191ce72e86346fb8b1d906e7cd930ea2'/>
<id>urn:sha1:cdb9ba84191ce72e86346fb8b1d906e7cd930ea2</id>
<content type='text'>
Use the __progname symbol to override the program name to induce the
failure that CVE-2025-0395 describes.

This is related to BZ #32582

Signed-off-by: Siddhesh Poyarekar &lt;siddhesh@sourceware.org&gt;
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2025-01-01T19:22:09Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-01-01T18:14:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=2642002380aafb71a1d3b569b6d7ebeab3284816'/>
<id>urn:sha1:2642002380aafb71a1d3b569b6d7ebeab3284816</id>
<content type='text'>
</content>
</entry>
<entry>
<title>assert: Sort tests in Makefile</title>
<updated>2024-12-21T21:55:39Z</updated>
<author>
<name>H.J. Lu</name>
<email>hjl.tools@gmail.com</email>
</author>
<published>2024-12-21T21:55:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=265e13d33c470446043a3d2033984a1197151e09'/>
<id>urn:sha1:265e13d33c470446043a3d2033984a1197151e09</id>
<content type='text'>
Signed-off-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</content>
</entry>
<entry>
<title>assert: ensure posix compliance, add tests for such</title>
<updated>2024-12-21T03:44:01Z</updated>
<author>
<name>DJ Delorie</name>
<email>dj@redhat.com</email>
</author>
<published>2024-11-14T20:12:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=e79e5c4899e82eff1032b1f8e530234c8fcbd8b9'/>
<id>urn:sha1:e79e5c4899e82eff1032b1f8e530234c8fcbd8b9</id>
<content type='text'>
Fix assert.c so that even the fallback
case conforms to POSIX, although not exactly the same as
the default case so a test can tell the difference.

Add a test that verifies that abort is called, and that the
message printed to stderr has all the info that POSIX requires.
Verify this even when malloc isn't usable.

Reviewed-by: Paul Eggert &lt;eggert@cs.ucla.edu&gt;
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2024-01-01T18:53:40Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-01-01T18:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307'/>
<id>urn:sha1:dff8da6b3e89b986bb7f6b1ec18cf65d5972e307</id>
<content type='text'>
</content>
</entry>
<entry>
<title>assert: Reformat Makefile.</title>
<updated>2023-05-18T16:56:45Z</updated>
<author>
<name>Carlos O'Donell</name>
<email>carlos@redhat.com</email>
</author>
<published>2023-05-18T16:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=ebd928224a138d4560dc0be3ef162162d62a9e43'/>
<id>urn:sha1:ebd928224a138d4560dc0be3ef162162d62a9e43</id>
<content type='text'>
Reflow all long lines adding comment terminators.
Sort all reflowed text using scripts/sort-makefile-lines.py.

No code generation changes observed in binary artifacts.
No regressions on x86_64 and i686.
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2023-01-06T21:14:39Z</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2023-01-06T21:08:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/glibc.git/commit/?id=6d7e8eda9b85b08f207a6dc6f187e94e4817270f'/>
<id>urn:sha1:6d7e8eda9b85b08f207a6dc6f187e94e4817270f</id>
<content type='text'>
</content>
</entry>
</feed>
