2024-04-18 21:29 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002431LibDOM[All Projects] Generalpublic2016-03-07 13:37
ReporterAnthony J. Bentley 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOpenBSDOS Version
Summary0002431: libdom testsuite uses reserved identifiers
DescriptionISO C reserves identifiers beginning with __ for the implementation.

The libdom test suite creates a function called __assert2, which conflicts with a function in OpenBSD's assert.h, resulting in a build failure before the tests can be run:

 COMPILE: test/level1_core_hc_attrname.c
cc -MMD -MP -std=c99 -D_BSD_SOURCE -D_DEFAULT_SOURCE -I/usr/ports/pobj/libdom-0. 3.0/libdom-0.3.0/include/ -I/usr/ports/pobj/libdom-0.3.0/libdom-0.3.0/src -I/usr/ports/pobj/libdom-0.3.0/libdom-0.3.0/binding -Wall -W -Wundef -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Werror -O2 -pipe -g -I/include -I/usr/local/include -D_ALIGNED="__attribute__((aligned))" -DNDEBUG -I/usr/local/include -I/usr/local/include -I/usr/local/include -Itest/ -Itest/testutils -Ibindings/xml -Ibindings/hubbub -Wno-unused -fno-strict-aliasing -o build-amd64-unknown-openbsd5.9-amd64-unknown-openbsd5.9-release-lib-shared/test_level1_core_hc_attrname.o -c test/level1_core_hc_attrname.c
In file included from test/testutils/domts.h:13,
                 from test/level1_core_hc_attrname.c:21:
test/testutils/domtsasserts.h:22: error: conflicting types for '__assert2'
/usr/include/assert.h:66: error: previous declaration of '__assert2' was here
/usr/local/share/netsurf-buildsystem/makefiles/Makefile.top:614: recipe for target 'build-amd64-unknown-openbsd5.9-amd64-unknown-openbsd5.9-release-lib-shared/test_level1_core_hc_attrname.o' failed
gmake: *** [build-amd64-unknown-openbsd5.9-amd64-unknown-openbsd5.9-release-lib-shared/test_level1_core_hc_attrname.o] Error 1

The attached patch renames the function, which allows the build to continue and all tests to pass.
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
Attached Files
  • diff file icon libdom-test_testutils.diff (1,041 bytes) 2016-02-22 02:39 -
    $OpenBSD$
    --- test/testutils/domtsasserts.c.orig	Sun Feb 21 04:47:54 2016
    +++ test/testutils/domtsasserts.c	Sun Feb 21 04:48:08 2016
    @@ -14,7 +14,7 @@
     
     #include "domts.h"
     
    -void __assert2(const char *expr, const char *function,
    +void dom_assert2(const char *expr, const char *function,
     		const char *file, int line)
     {
     	UNUSED(function);
    $OpenBSD$
    --- test/testutils/domtsasserts.h.orig	Sun Feb 21 04:34:08 2016
    +++ test/testutils/domtsasserts.h	Sun Feb 21 04:34:06 2016
    @@ -18,12 +18,12 @@
     /* Redefine assert, so we can simply use the standard assert mechanism
      * within testcases and exit with the right output for the testrunner
      * to do the right thing. */
    -void __assert2(const char *expr, const char *function,
    +void dom_assert2(const char *expr, const char *function,
     		const char *file, int line);
     
     #undef assert
     #define assert(expr) \
    -  ((void) ((expr) || (__assert2 (#expr, __func__, __FILE__, __LINE__), 0)))
    +  ((void) ((expr) || (dom_assert2 (#expr, __func__, __FILE__, __LINE__), 0)))
     
     bool is_true(bool arg);
     
    
    diff file icon libdom-test_testutils.diff (1,041 bytes) 2016-02-22 02:39 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2016-02-22 02:39 Anthony J. Bentley New Issue
2016-02-22 02:39 Anthony J. Bentley File Added: libdom-test_testutils.diff
2016-03-07 13:37 Vincent Sanders Status new => confirmed
+Issue History