Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 948356

Summary: dev-libs/userspace-rcu-0.15.0 compile error urcu-bp.c implicit declaration of function assert
Product: Gentoo Linux Reporter: Joe Harvell <landshark>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: normal CC: landshark
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 870412    
Attachments: emerge --info
add required include of assert.h

Description Joe Harvell 2025-01-18 17:13:14 UTC
Compiling with gcc14 it looks like assert.h is needed but not (transitively included).  See below:

urcu-bp.c: In function 'expand_arena':
urcu-bp.c:412:17: error: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
  412 |                 assert(new_chunk == last_chunk);
      |                 ^~~~~~
urcu-bp.c:42:1: note: 'assert' is defined in header '<assert.h>'; this is probably fixable by adding '#include <assert.h>'
   41 | #include <urcu/urcu-bp.h>
  +++ |+#include <assert.h>
   42 | #define _LGPL_SOURCE
urcu-bp.c:412:17: warning: nested extern declaration of 'assert' [-Wnested-externs]
  412 |                 assert(new_chunk == last_chunk);


Reproducible: Always

Steps to Reproduce:
1.compile with gcc14
2.
3.
Actual Results:  
compile fails as summarized in description

Expected Results:  
compile success
Comment 1 Joe Harvell 2025-01-18 17:14:40 UTC
Created attachment 917008 [details]
emerge --info

output of emerge --info
Comment 2 Joe Harvell 2025-01-18 17:15:54 UTC
Created attachment 917009 [details, diff]
add required include of assert.h
Comment 3 Joe Harvell 2025-01-18 17:16:29 UTC
package compiles successfully with attached patch
Comment 4 Joe Harvell 2025-01-18 17:20:46 UTC
jharvell@wolfhound ~$ gcc-config -l
 [1] x86_64-pc-linux-gnu-12
 [2] x86_64-pc-linux-gnu-13
 [3] x86_64-pc-linux-gnu-14 *

jharvell@wolfhound ~$ gcc --version
gcc (Gentoo 14.2.1_p20241221 p7) 14.2.1 20241221
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-18 17:53:03 UTC
Note that this is caused by -DNDEBUG. Please send the patch upstream.