munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.84k stars 1.04k forks source link

make c_chapters broken for chapter 18 #796

Closed ceronman closed 4 years ago

ceronman commented 4 years ago

Today I learned about make java_chapters and make c_chapters. This seems very useful to get more context, specially when implementing Lox in other languages.

I pulled the latest master of this repository (c6da0e61e6072271de404464c34b51c2fdc39e59) and then I noticed that make c_chapters is failing at Chapter 18

The error I get is:

make[1]: Entering directory '/home/ceronman/code/github/craftinginterpreters'
      cc gen/chap18_types/chunk.c                 -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -O3 -flto
      cc gen/chap18_types/value.c                 -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -O3 -flto
gen/chap18_types/value.c: In function ‘valuesEqual’:
gen/chap18_types/value.c:41:1: error: control reaches end of non-void function [-Werror=return-type]
   41 | }
      | ^
cc1: all warnings being treated as errors
make[1]: *** [util/c.make:42: build/release/chap18_types/value.o] Error 1
make[1]: Leaving directory '/home/ceronman/code/github/craftinginterpreters'
make: *** [Makefile:127: c_chapters] Error 2

Some details about my gcc version in case this helps:

$ cc --version
cc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks a lot for this fantastic book! I've had a great time reading it and implementing lox!

munificent commented 4 years ago

Yeah, GCC seems to be more particular about this than clang. Should be fixed now, thanks!