[binutils-gdb] gas/codeview: avoid "shadowing" of glibc function name

Jan Beulich jbeulich@sourceware.org
Mon Dec 12 08:50:02 GMT 2022


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=af327b04a5560163713222ebcc94f587441be127

commit af327b04a5560163713222ebcc94f587441be127
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Dec 12 09:49:44 2022 +0100

    gas/codeview: avoid "shadowing" of glibc function name
    
    While not "index" this time, old enough glibc also has an (unguarded)
    declaration of fileno() in stdio.h, which triggers a "shadows a global
    declaration" warning with our choice of warning level and with at least
    some gcc versions.

Diff:
---
 gas/codeview.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gas/codeview.c b/gas/codeview.c
index 13f1a3a3223..15764028d73 100644
--- a/gas/codeview.c
+++ b/gas/codeview.c
@@ -452,7 +452,7 @@ void
 codeview_generate_asm_lineno (void)
 {
   const char *file;
-  unsigned int fileno;
+  unsigned int filenr;
   unsigned int lineno;
   struct line *l;
   symbolS *sym = NULL;
@@ -461,7 +461,7 @@ codeview_generate_asm_lineno (void)
 
   file = as_where (&lineno);
 
-  fileno = get_fileno (file);
+  filenr = get_fileno (file);
 
   if (!blocks_tail || blocks_tail->frag != frag_now)
     {
@@ -492,11 +492,11 @@ codeview_generate_asm_lineno (void)
       lb = blocks_tail;
     }
 
-  if (!lb->files_tail || lb->files_tail->fileno != fileno)
+  if (!lb->files_tail || lb->files_tail->fileno != filenr)
     {
       lf = xmalloc (sizeof (struct line_file));
       lf->next = NULL;
-      lf->fileno = fileno;
+      lf->fileno = filenr;
       lf->lines_head = lf->lines_tail = NULL;
       lf->num_lines = 0;


More information about the Binutils-cvs mailing list