https://sourceware.org/bugzilla/show_bug.cgi?id=33696

            Bug ID: 33696
           Summary: Build failure with C23
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: guinevere at redhat dot com
  Target Milestone: ---

Attempting to compile gas with C23 will result in the following error:

../../binutils-gdb/gas/read.c: In function ‘find_no_app’:
../../binutils-gdb/gas/read.c:870:20: error: initialization discards ‘const’
qualifier from pointer target type [-Werror=discarded-qualifiers]
  870 |       char *ends = strstr (s, srch);
      |                    ^~~~~~

That's because in C23, strstr and similar functions will return const char * if
fed a const char *

The issue here is that changing this variable will require changing a function
signature and so on, until needing to change input_line_pointer, which is used
to change the code in the memory region, so it can't just be turned into a
const variable.

I have not tried making the `s` parameter of find_no_app non-const, so that may
be an easier fix, if deemed to be correct.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to