Older compilers warn if a file does not end with an empty line.
Since the Mitk core library treats warnings as errors, the compilation of Mitk will fail on such systems.
zelzer | |
May 30 2012, 3:31 PM |
F840: FixNewLines.sh | |
May 31 2012, 9:35 AM |
Older compilers warn if a file does not end with an empty line.
Since the Mitk core library treats warnings as errors, the compilation of Mitk will fail on such systems.
We should think of adding a git hook for checking the existence of a newline.
This probably relates with a general tooling support for checking source code style.
Hi Sascha, does the attached script help? For me it changed 199 files. However, there is only any point running it, if a commit hook is in place?
Matt
Hi, thanks for the script. I use the following script yesterday already :-)
#!/bin/bash
for i in find . -iname *.h -or -iname *.cpp -or -iname *.txx -or -iname *.cxx -or -iname *.c ; do
if diff /dev/null "$i" | tail -1 | grep '^\\ No newline' > /dev/null; then echo $i; echo >> $i; fi;
done
I just wanted to merge, but still have to remove tabs which weren't checked for in the past, but are now blocked by a git hook.
We will add a git hook for the newline next week.
Excellent. I think this is quicker for me than compiling a new compiler on two different architectures :-)
M@
[5dd591]: Merge branch 'bug-12044-fix-no-newline-warning'
2012-05-30 15:51:04 Sascha Zelzer [d1ff84]
Added missing newline characters.
If there are new files with missing newlines added to the repo before we can install the git hook, just reopen the bug.