This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/80428] New: Incorrect -Wunused-const-variable= instance


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80428

            Bug ID: 80428
           Summary: Incorrect -Wunused-const-variable= instance
           Product: gcc
           Version: 6.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tom.rini at gmail dot com
  Target Milestone: ---

With U-Boot v2017.05-rc1 and the 'ts4600_config' (make ts4600_config all to
reproduce) we see:
/home/trini/work/u-boot/u-boot/common/cli_readline.c:20:21: warning: ‘tab_seq’
defined but not used [-Wunused-const-variable=]
 static const char   tab_seq[] = "        "; /* used to expand TABs */
                     ^~~~~~~
/home/trini/work/u-boot/u-boot/common/cli_readline.c:19:19: warning:
‘erase_seq’ defined but not used [-Wunused-const-variable=]
 static const char erase_seq[] = "\b \b"; /* erase sequence */

The code in question is at:
http://git.denx.de/?p=u-boot.git;a=blob;f=common/cli_readline.c;h=ecded11ca3985f27b132ef4d20f7e79ee02c8379;hb=11db152246607868f0e74db958947fbf79f28119

If we examine the generated .map file we can see that
cli_readline_into_buffer() is kept in the binary as it is used.  That in turn
makes use of both tab_seq and erase_seq (as well as delete_char() which also
uses them).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]