rui314 / 8cc

A Small C Compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make test fails with timestamp error

gergo- opened this issue · comments

When running "make test" after compiling 8cc with GCC (4.8.2 on a current Linux Mint), I get the following failure:

Testing macros ... Failed test/macro.c:29: "Thu Apr 02 18:42:49 2015" expected, but got "Thu Apr 2 18:42:49 2015"

The day of the month is zero-padded in 8cc's get_timestamp function, but GCC's __TIMESTAMP__ macro is space-padded, as documented: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
I note that Clang's documentation does not specify the format of __TIMESTAMP__: http://clang.llvm.org/docs/LanguageExtensions.html but I can't check its actual behavior right now.

Thanks for reporting. We had a similar bug before (0e069b3). I'll fix later.

Fixed in 9cd74f7.