MantisBT - Hubbub
View Issue Details
0002619Hubbub[All Projects] Generalpublic2018-09-24 23:472019-08-01 11:31
ReporterJ. Peter Mugaas 
Assigned ToDaniel Silverstone 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusacknowledgedResolutionopen 
Platformmingw-w64OSWindowsOS Version10 (64-bit)
Product Version0.3.1 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #
Summary0002619: 0.3.5 -tokenizer2 test fails to compile
DescriptionI was trying to compile the tokenizer.c in the test suit and I found a compile issue.

I got an error saying:

[ 91%] Building C object CMakeFiles/tokeniser2_shared.dir/test/tokeniser2.c.obj
In file included from D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/tokeniser2.c:15:
D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/tokeniser2.c: In function 'main':
D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/tokeniser2.c:51:10: warning: implicit declaration of function 'is_error'; did you mean 'mc_error'? [-Wimplicit-function-declaration]
  assert(!is_error(json));
          ^~~~~~~~
D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/testutils.h:31:13: note: in definition of macro 'assert'
   ((void) ((expr) || (__assert2 (#expr, __func__, __FILE__, __LINE__), 0)))
             ^~~~
[ 93%] Linking C executable csdetect_shared.exe
[ 94%] Linking C executable entities_shared.exe
[ 95%] Linking C executable parser_shared.exe
[ 97%] Linking C executable tokeniser_shared.exe
[ 98%] Linking C executable tree_shared.exe
[100%] Linking C executable tokeniser2_shared.exe
[100%] Built target entities_shared
[100%] Built target csdetect_shared
[100%] Built target parser_shared
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/tokeniser2_shared.dir/objects.a(tokeniser2.c.obj):tokeniser2.c:(.text.startup+0x63): undefined reference to `is_error'
collect2.exe: error: ld returned 1 exit status
[100%] Built target tokeniser_shared

This occured with json-c 0.13.1. The problem was that tokenizer2.c requires the bits.h header. Note that I am using cmake to build this library but I don't think that's the issue because I was able to fix the tokener.c file and I'm including a patch to do that.


TagsNo tags attached.
Attached Filespatch fix-test-tokenizer2.patch (278) 2018-09-24 23:47
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=560&type=bug
patch fix-test-tokenizer2-2.patch (556) 2018-09-25 01:29
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=561&type=bug

Notes
(0001848)
J. Peter Mugaas   
2018-09-25 01:29   
It looks like this also effects the tokeniser3.c test series. I am including an updated patch to fix that as well.

---
[ 84%] Building C object CMakeFiles/entities_shared.dir/test/entities.c.obj
[ 82%] Building C object CMakeFiles/parser_shared.dir/test/parser.c.obj
[ 85%] Building C object CMakeFiles/tree_shared.dir/test/tree.c.obj
[ 86%] Building C object CMakeFiles/tokeniser_shared.dir/test/tokeniser.c.obj
[ 88%] Building C object CMakeFiles/tokeniser3_shared.dir/test/tokeniser3.c.obj
[ 89%] Building C object CMakeFiles/csdetect_shared.dir/test/csdetect.c.obj
[ 90%] Building C object CMakeFiles/tokeniser2_shared.dir/test/tokeniser2.c.obj
In file included from D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/tokeniser3.c:15:
D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/tokeniser3.c: In function 'main':
D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/tokeniser3.c:49:10: warning: implicit declaration of function 'is_error'; did you mean 'mc_error'? [-Wimplicit-function-declaration]
  assert(!is_error(json));
          ^~~~~~~~
D:/msys64/home/jpmugaas/exp/mingw-w64-libhubbub/src/libhubbub-0.3.5/test/testutils.h:31:13: note: in definition of macro 'assert'
   ((void) ((expr) || (__assert2 (#expr, __func__, __FILE__, __LINE__), 0)))
             ^~~~
[ 92%] Linking C executable entities_shared.exe
[ 93%] Linking C executable parser_shared.exe
[ 94%] Linking C executable tokeniser_shared.exe
[ 96%] Linking C executable csdetect_shared.exe
[ 97%] Linking C executable tree_shared.exe
[ 98%] Linking C executable tokeniser2_shared.exe
[100%] Linking C executable tokeniser3_shared.exe
[100%] Built target entities_shared
[100%] Built target parser_shared
[100%] Built target tokeniser_shared
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/tokeniser3_shared.dir/objects.a(tokeniser3.c.obj):tokeniser3.c:(.text.startup+0x63): undefined reference to `is_error'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/tokeniser3_shared.dir/build.make:86: tokeniser3_shared.exe] Error 1

---
(0002045)
Daniel Silverstone   
2019-08-01 11:31   
This is very odd because `json.h` includes `bits.h` and thus should not need an additional include in order to make it work.

Do you have a conflicting `json.h` on your search path?

Issue History
2018-09-24 23:47J. Peter MugaasNew Issue
2018-09-24 23:47J. Peter MugaasFile Added: fix-test-tokenizer2.patch
2018-09-25 01:29J. Peter MugaasFile Added: fix-test-tokenizer2-2.patch
2018-09-25 01:29J. Peter MugaasNote Added: 0001848
2019-08-01 11:31Daniel SilverstoneNote Added: 0002045
2019-08-01 11:31Daniel SilverstoneAssigned To => Daniel Silverstone
2019-08-01 11:31Daniel SilverstoneStatusnew => assigned
2019-08-01 11:31Daniel SilverstoneStatusassigned => acknowledged