[lz4-frame] in ci.yml contains the following command
```
make -C tests test-frametest
```
[lz4-fuzzer] in ci.yml contains the following command
```
make -C tests test-fuzzer
```
lz4-platform-macos-latest[1] in ci.yml contains the following test command
```
make # test library build
make test MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion' | tee
```
[1] 025c3ce8f9/.github/workflows/ci.yml (L450)
To support older compiler which doesn't have explicit dialect option
for C90 (gcc-4.4), this change set split "c_standards" into multiple
part.
Original "make c_standards" still works as intended. But this change
gives extra freedom of choice for external program For example, CI
can choose test for standards which is supported by specimen compiler.
With this separation, we can also introduce C17 smoothly.
The following command doesn't work as intended
```
cd
git clone https://github.com/lz4/lz4.git
cd lz4
make usan MOREFLAGS='-Wcomma -Werror'
```
```
Cleaning completed
cc: error: unrecognized command line option ‘-Wcomma’; did you mean ‘-Wcomment’?
make[3]: *** [<builtin>: ../lib/lz4.o] Error 1
make[2]: *** [Makefile:65: lz4] Error 2
make[1]: *** [Makefile:133: test] Error 2
make: *** [Makefile:158: usan] Error 2
```
Because the following part of the `Makefile` doesn't propagate `CC`, `CFLAGS` and `LDFLAGS` to child `$(MAKE)` properly.
```
.PHONY: usan
usan: CC = clang
usan: CFLAGS = -O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow
usan: LDFLAGS = $(CFLAGS)
usan: clean
$(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
```
We need explicit propagation for child process
```
- $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
+ CC=$(CC) CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
```
After that, `make usan` works and it shows expected runtime error.
```
$ make usan MOREFLAGS='-Wcomma -Werror'
Cleaning completed
../lib/lz4frame.c:907:25: runtime error: applying non-zero offset 65536 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../lib/lz4frame.c:907:25 in
../lib/lz4frame.c:907:58: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../lib/lz4frame.c:907:58 in
...
```
Please note that `make usan` is working at travis-ci. Because `.travis.yml` has the following [explicit `compiler:` setting](7a966c1511/.travis.yml (L66)).
```
- name: (Trusty) USan test
dist: trusty
compiler: clang
script:
- make usan MOREFLAGS=-Wcomma -Werror
```