linux-can / can-utils

Linux-CAN / SocketCAN user space applications
2.37k stars 708 forks source link

mcp251xfd-regmap: fix compiler warning #506

Closed Chaitanya84 closed 6 months ago

Chaitanya84 commented 6 months ago

There is no action or impact of the code change just to remove compiler warning during make all

marckleinebudde commented 6 months ago

Which compiler warning are you seeing? Which compiler are you using?

Chaitanya84 commented 6 months ago
mcp251xfd/mcp251xfd-regmap.c: In function ‘do_mcp251xfd_regmap_read’:
mcp251xfd/mcp251xfd-regmap.c:39:25: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   39 |                         fscanf(reg_file, "%*[^\n]\n");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is the compiler version used to compile

gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
marckleinebudde commented 6 months ago

I see, ubunut has FORTIFY_SOURCE enabled by default, to reproduce: use /configure CPPFLAGS='-D_FORTIFY_SOURCE=2.