Fails to build on ubuntu 20.04.4
Build log: https://dweb.link/ipfs/bafybeifnhfeoo6lj4pnk7xudqf7m3k5gxzgvhghc7n2vzajwdkqtctrfmy/make.log
gcc version: 7.5.0
I think this is because of -wall -wextra -werror
I think this is because of -wall -wextra -werror
NO! It is for error reporting. When you don't know, don't say anything plz
What is the github of the project ?
I have edited away this comment I made while upset and confused, which I am very sorry for. I guess frexsdev must have misposted the github project question here by accident, and I responded very poorly. If it's unclear, this github right here is the project in question. Be well, frexsdev and ahelwer. Thank you for looking at my issue.
Is this still a problem? If so we need more information. The provided link also does not work.
I am no longer using either ubuntu or this project at this time, but here is more conventional ipfs.io link to the build log: https://ipfs.io/ipfs/bafybeifnhfeoo6lj4pnk7xudqf7m3k5gxzgvhghc7n2vzajwdkqtctrfmy/make.log . It's just an ipfs file; it's still on ipfs.
Here's the content. Do IPFS links from other people work for you?
cc -O3 -Wall -Wextra -Werror -std=gnu99 -fPIC -Ilib/src -Ilib/include -c -o lib/src/subtree.o lib/src/subtree.c
lib/src/subtree.c: In function ‘ts_subtree_string’:
lib/src/subtree.c:852:25: error: ‘(NULL)’ directive output truncated writing 6 bytes into a region of size 1 [-Werror=format-truncation=]
if (!self.ptr) return snprintf(string, limit, "(NULL)");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 7 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:875:17: error: ‘(UNEXPECTED ’ directive output truncated writing 12 bytes into a region of size 1 [-Werror=format-truncation=]
cursor += snprintf(*writer, limit, "(UNEXPECTED ");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 13 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:818:12: error: ‘INVALID’ directive output truncated writing 7 bytes into a region of size 1 [-Werror=format-truncation=]
return snprintf(s, n, "INVALID");
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 8 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:820:12: error: ‘'\0'’ directive output truncated writing 4 bytes into a region of size 1 [-Werror=format-truncation=]
return snprintf(s, n, "'\\0'");
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 5 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:822:12: error: ‘'\n'’ directive output truncated writing 4 bytes into a region of size 1 [-Werror=format-truncation=]
return snprintf(s, n, "'\\n'");
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 5 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:824:12: error: ‘'\t'’ directive output truncated writing 4 bytes into a region of size 1 [-Werror=format-truncation=]
return snprintf(s, n, "'\\t'");
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 5 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:826:12: error: ‘'\r'’ directive output truncated writing 4 bytes into a region of size 1 [-Werror=format-truncation=]
return snprintf(s, n, "'\\r'");
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 5 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:828:12: error: ‘%c’ directive output truncated writing 1 byte into a region of size 0 [-Werror=format-truncation=]
return snprintf(s, n, "'%c'", c);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output 4 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:830:12: error: ‘__builtin___snprintf_chk’ output truncated before the last format character [-Werror=format-truncation=]
return snprintf(s, n, "%d", c);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 2 and 12 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:885:21: error: ‘"’ directive output truncated writing 1 byte into a region of size 0 [-Werror=format-truncation=]
cursor += snprintf(*writer, limit, "\"%s\"", symbol_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output 3 or more bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:888:19: error: ‘__builtin___snprintf_chk’ output truncated before the last format character [-Werror=format-truncation=]
cursor += snprintf(*writer, limit, "(%s", symbol_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output 2 or more bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:894:15: error: ‘("’ directive output truncated writing 2 bytes into a region of size 1 [-Werror=format-truncation=]
cursor += snprintf(*writer, limit, "(\"%s\")", symbol_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output 5 or more bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:942:29: error: ‘__builtin_snprintf’ output truncated before the last format character [-Werror=format-truncation=]
if (is_visible) cursor += snprintf(*writer, limit, ")");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 2 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:881:19: error: ‘(MISSING ’ directive output truncated writing 9 bytes into a region of size 1 [-Werror=format-truncation=]
cursor += snprintf(*writer, limit, "(MISSING ");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 10 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/src/subtree.c:881:19: error: ‘(MISSING ’ directive output truncated writing 9 bytes into a region of size 1 [-Werror=format-truncation=]
cursor += snprintf(*writer, limit, "(MISSING ");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867:0,
from lib/src/subtree.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output 10 bytes into a destination of size 1
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: lib/src/subtree.o] Error 1
Those are just warnings. Werror has been removed. Just ignore.
Thanks. These warnings of course are intended to catch severe buffer overflows. I infer you have reviewed the code and situation and verified it is okay.
Lol no. But I can't recreate the warning. If you can, feel free to open a new issue.
Thanks. I'm not set up to test this anymore. We'll see. But thank you.