Hello
Here you are :)
[ 98%] Building C object src/lut/CMakeFiles/darktable-lut.dir/common.c.o
[ 98%] /home/sasha/Install/darktable/src/lut/pfm.c: In function ‘read_pfm’:
/home/sasha/Install/darktable/src/lut/pfm.c:40:9: error: ignoring return
value of ‘fscanf’, declared with attribute warn_unused_result
[-Werror=unused-result]
fscanf(f, "%c%c %d %d ", &magic[0], &magic[1], &width, &height);
^
/home/sasha/Install/darktable/src/lut/pfm.c:41:9: error: ignoring return
value of ‘fscanf’, declared with attribute warn_unused_result
[-Werror=unused-result]
fscanf(f, " %63s ", scale_factor_string);
^
cc1: all warnings being treated as errors
With respect,
Alexander Rabtchevich
johannes hanika wrote:
i really think this compiler warning is stupid. leads to all sorts of
idiotic non-error handling code around fscanf and the likes. can you
try current master again?
j.
On Sun, Apr 24, 2016 at 7:18 AM, Christian Tellefsen
<[email protected]> wrote:
On 23. april 2016 19:23, Alexander Rabtchevich wrote:
Hello
Today commits have introduced a building error. Mint Mate 17.3, x64.
[ 98%] Building C object
src/lut/CMakeFiles/darktable-lut.dir/colorchart.c.o
Linking C executable darktable-generate-cache
Linking C executable darktable-cli
/home/sasha/Install/darktable/src/lut/main.c: In function ‘parse_csv’:
/home/sasha/Install/darktable/src/lut/main.c:1522:9: error: ignoring
return value of ‘fscanf’, declared with attribute warn_unused_result
[-Werror=unused-result]
fscanf(f, "%15[^;];%255[^\n]\n", key, value);
^
Some digging later ...
This came in via lut earlier today.
The problem is caused by /usr/include/stdio.h declaring fscanf with __wur:
extern int fscanf (FILE *__restrict __stream,
const char *__restrict __format, ...) __wur;
The straightforward fix would be:
-fscanf(f, "%15[^;];%255[^\n]\n", key, value);
+(void) fscanf(f, "%15[^;];%255[^\n]\n", key, value);
However, gcc still insists on checking the return value..
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509#c11
(found via http://stackoverflow.com/a/7273026 )
I'll leave this one for Tobias ... :-)
For those wanting to compile in the meantime, remove -Werror from the
following line in src/CMakeLists.txt:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=type-limits")
^------- remove
Christian
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to [email protected]