2024-03-28 17:24 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002619Hubbub[All Projects] Generalpublic2019-08-01 10:31
ReporterJ. Peter Mugaas 
Assigned ToDaniel Silverstone 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusacknowledgedResolutionopen 
Platformmingw-w64OSWindowsOS Version10 (64-bit)
Product Version0.3.1 
Target VersionFixed in Version 
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.
Fixed in CI build #
Reported in CI build #
Attached Files
  • patch file icon fix-test-tokenizer2.patch (278 bytes) 2018-09-24 22:47 -
    --- libhubbub-0.3.5/test/tokeniser2.c.orig	2018-09-24 18:14:23.674302100 -0400
    +++ libhubbub-0.3.5/test/tokeniser2.c	2018-09-24 18:15:06.977567400 -0400
    @@ -3,6 +3,7 @@
     #include <string.h>
     
     #include <json.h>
    +#include <bits.h>
     
     #include <parserutils/input/inputstream.h>
     
    
    patch file icon fix-test-tokenizer2.patch (278 bytes) 2018-09-24 22:47 +
  • patch file icon fix-test-tokenizer2-2.patch (556 bytes) 2018-09-25 00:29 -
    --- libhubbub-0.3.5/test/tokeniser2.c.orig	2018-09-24 18:14:23.674302100 -0400
    +++ libhubbub-0.3.5/test/tokeniser2.c	2018-09-24 18:15:06.977567400 -0400
    @@ -3,6 +3,7 @@
     #include <string.h>
     
     #include <json.h>
    +#include <bits.h>
     
     #include <parserutils/input/inputstream.h>
     
    --- libhubbub-0.3.5/test/tokeniser3.c.orig	2018-09-24 19:18:42.736591200 -0400
    +++ libhubbub-0.3.5/test/tokeniser3.c	2018-09-24 19:23:23.310127200 -0400
    @@ -3,6 +3,7 @@
     #include <string.h>
     
     #include <json.h>
    +#include <bits.h>
     
     #include <parserutils/input/inputstream.h>
     
    
    patch file icon fix-test-tokenizer2-2.patch (556 bytes) 2018-09-25 00:29 +

-Relationships
+Relationships

-Notes
J. Peter Mugaas

~0001848

J. Peter Mugaas (reporter)

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

---
Daniel Silverstone

~0002045

Daniel Silverstone (administrator)

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?
+Notes

-Issue History
Date Modified Username Field Change
2018-09-24 22:47 J. Peter Mugaas New Issue
2018-09-24 22:47 J. Peter Mugaas File Added: fix-test-tokenizer2.patch
2018-09-25 00:29 J. Peter Mugaas File Added: fix-test-tokenizer2-2.patch
2018-09-25 00:29 J. Peter Mugaas Note Added: 0001848
2019-08-01 10:31 Daniel Silverstone Note Added: 0002045
2019-08-01 10:31 Daniel Silverstone Assigned To => Daniel Silverstone
2019-08-01 10:31 Daniel Silverstone Status new => assigned
2019-08-01 10:31 Daniel Silverstone Status assigned => acknowledged
+Issue History