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]
>
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to [email protected]

Reply via email to