Page MenuHomeFreeBSD

Fix ncurses fallback.c build with a strict build shell

Authored by arichardson on Aug 23 2018, 2:14 PM.



The script uses shift three times and when building with a strict /bin/sh
shifting without any arguments will cause the script to fail. In this case
the target will fail and we write an empty output file. When doing a
NO_CLEAN build after this will mean fallback.c is up to date and clang
will happily compile the empty input file which leads to strange build
errors later.

Fixed by passing three empty arguments to and only creating
fallback.c if succeeds.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

353 ↗(On Diff #47171)

I think you want to add fallback.c.tmp to CLEANFILES so it's removed by make clean if a failure occurs.

353 ↗(On Diff #47171)

It is removed by make clean. However, if the make rule fails there will be an empty (up-to-date) output file so it won't be rebuilt.

This revision is now accepted and ready to land.Aug 23 2018, 8:43 PM
This revision was automatically updated to reflect the committed changes.