Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc fails to build on current compilers #16

Open
joshtriplett opened this issue Aug 27, 2020 · 2 comments
Open

sc fails to build on current compilers #16

joshtriplett opened this issue Aug 27, 2020 · 2 comments
Assignees

Comments

@joshtriplett
Copy link

Trying to run build-bench-env.sh on a system with GCC 10.2.0 resulted in this error from sc:

--------------------------------------------
build sc: version master
--------------------------------------------

/tmp/mimalloc-bench/extern /tmp/mimalloc-bench
Cloning into 'scalloc'...
remote: Enumerating objects: 3308, done.
remote: Total 3308 (delta 0), reused 0 (delta 0), pack-reused 3308
Receiving objects: 100% (3308/3308), 1.03 MiB | 4.95 MiB/s, done.
Resolving deltas: 100% (2261/2261), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
updating dependencies for scalloc

gyp... 

Cloning into 'build/gyp'...
remote: Total 18491 (delta 12809), reused 18491 (delta 12809)
Receiving objects: 100% (18491/18491), 8.60 MiB | 5.14 MiB/s, done.
Resolving deltas: 100% (12809/12809), done.

gyp... done
  CXX(target) out/Release/obj.target/scalloc/src/glue.o
In file included from src/platform/assert.h:8,
                 from src/arena.h:12,
                 from src/glue.h:12,
                 from src/glue.cc:5:
src/log.h: In function ‘void LogPrintf(int, const char*, const char*, ...)’:
src/log.h:51:10: error: ‘char* strncat(char*, const char*, size_t)’ specified bound 1 equals source length [-Werror=stringop-overflow=]
   51 |   strncat(buffer, ":", 1);
      |   ~~~~~~~^~~~~~~~~~~~~~~~
src/log.h:55:10: error: ‘char* strncat(char*, const char*, size_t)’ specified bound 1 equals source length [-Werror=stringop-overflow=]
   55 |   strncat(buffer, " ", 1);
      |   ~~~~~~~^~~~~~~~~~~~~~~~
src/log.h:75:10: error: ‘char* strncat(char*, const char*, size_t)’ specified bound 1 equals source length [-Werror=stringop-overflow=]
   75 |   strncat(buffer, "\n", 1);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~
src/log.h:70:12: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation]
   70 |     strncpy(rest_start + (rest - strlen(truncate_suffix)),
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   71 |             truncate_suffix,
      |             ~~~~~~~~~~~~~~~~
   72 |             strlen(truncate_suffix));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
src/log.h:49:10: error: ‘char* strncat(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
   49 |   strncat(buffer, file, strlen(file));
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/log.h:53:10: error: ‘char* strncat(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
   53 |   strncat(buffer, line_buffer, strlen(line_buffer));
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [scalloc.target.mk:118: out/Release/obj.target/scalloc/src/glue.o] Error 1
@daanx
Copy link
Owner

daanx commented Dec 15, 2020

Yeah, their make is passing a flag to treat warnings as errors to there is not much I can do..

@joshtriplett
Copy link
Author

You might consider disabling it by default, until it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants