bugGNU roff - Bugs: bug #62540, refer/ref.cpp: comparison between...

 
 

bug #62540: refer/ref.cpp: comparison between two arrays is deprecated in C++20

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Mon 30 May 2022 02:28:13 AM UTC
   
 
Category:  Preprocessor refer Severity:  2 - Minor
Item Group:  Lint Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 01 Jun 2022 12:42:24 AM UTC, comment #3: 

Thanks for the follow-up.

I am at pains to get groff up to the C++98 standard.

C++20/23 is probably a long way in the future for this code base.

G. Branden Robinson <gbranden>
Group administrator
Mon 30 May 2022 06:41:58 PM UTC, comment #2: 

g++ is (Debian 12.1.0-2) 12.1.0

GNU Troff version 1.22.4.4708-3fdde
----------------------------------------------------------------------
 installation prefix              : /usr/local
 C++ compiler                     : g++ -Walloc-zero -Walloca -Wall
-Wextra -Wformat=2 -Wattribute-warning -Wdate-time -Wfree-nonheap-object
-Wimplicit-fallthrough=3 -Wmaybe-uninitialized -Wstringop-overflow=4
-Wredundant-decls -Wshadow=global -Wuninitialized -Wunused
-Wunused-parameter -Wvla -fdiagnostics-generate-patch -fsanitize=bool
-fsanitize=enum -fsanitize=signed-integer-overflow
-fsanitize-undefined-trap-on-error -O2 -fstack-protector-strong
-fno-common -fstack-clash-protection -ftrapv -funsigned-char
-fvar-tracking-assignments -ggdb3  -fcheck-new -Wmismatched-new-delete
-Wmissing-requires -Wredundant-decls -Wdelete-incomplete -std=c++23
-D_FORTIFY_SOURCE=2 -DGCC_LINT
 use libgroff's memory allocator  : no
 C compiler                       : /usr/bin/gcc-12 -Walloc-zero
-Walloca -Wall -Wextra -Wformat=2 -Wattribute-warning -Wdate-time
-Wfree-nonheap-object -Wimplicit-fallthrough=3 -Wmaybe-uninitialized
-Wstringop-overflow=4 -Wredundant-decls -Wshadow=global
-Wuninitialized -Wunused -Wunused-parameter -Wvla
-fdiagnostics-generate-patch -fsanitize=bool -fsanitize=enum
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error
-O2 -fstack-protector-strong -fno-common -fstack-clash-protection
-ftrapv -funsigned-char -fvar-tracking-assignments -ggdb3
-Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes
-Wold-style-declaration  -std=c2x  -D_FORTIFY_SOURCE=2 -DGCC_LINT
 Perl interpreter version         : 5.34.0
 X11 support                      : enabled
 X11 app defaults directory       : /usr/local/lib/X11/app-defaults
 'groff -l' uses print spooler    : no
 use URW fonts for PDF output     : yes
 preconv can use uchardet library : yes
 tests can use PDF tools          : yes
----------------------------------------------------------------------


Bjarni Ingi Gislason <bjarniig>
Mon 30 May 2022 05:53:59 PM UTC, comment #1: 

Hi Bjarni,

Can you post the configuration report you got from the build you quote?

By "configuration report", I mean this part.


GNU Troff version 1.23.0.rc1.2497-074da
----------------------------------------------------------------------
 installation prefix              : /usr/local
 C++ compiler                     : g++ -Wall -Wextra -Wformat=2  -Wstringop-overflow=4 -Wshadow=global -Wredundant-decls -Wunused -Wunused-parameter -fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error -fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv -funsigned-char -fvar-tracking-assignments  -ggdb -Og -fcheck-new -Wredundant-decls -std=c++98 -pedantic -Wformat=2 -D_FORTIFY_SOURCE=2
 use libgroff's memory allocator  : no
 C compiler                       : gcc -Wall -Wextra -Wformat=2  -Wstringop-overflow=4 -Wshadow=global -Wredundant-decls -Wunused -Wunused-parameter -fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error -fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv -funsigned-char -fvar-tracking-assignments  -ggdb -Og -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -Wold-style-declaration  -Wformat=2 -D_FORTIFY_SOURCE=2
 Perl interpreter version         : 5.32.1
 X11 support                      : enabled
 X11 app defaults directory       : /usr/local/lib/X11/app-defaults
 'groff -l' uses print spooler    : lpr
 use URW fonts for PDF output     : yes
 preconv can use uchardet library : yes
 tests can use PDF tools          : yes
----------------------------------------------------------------------


I don't need any of the notices that may appear subsequently, about X11 app-defaults or buggy Ghostscript or similar.

G. Branden Robinson <gbranden>
Group administrator
Mon 30 May 2022 02:28:13 AM UTC, original submission:  

Subject: refer/ref.cpp: comparison between two arrays is deprecated in
C++20

  Warning from gcc-12 (Debian 12.1.0-2) 12.1.0:

  CXX      src/preproc/refer/refer-ref.o
../src/preproc/refer/ref.cpp: In function 'int same_reference(const reference&, const reference&)':
../src/preproc/refer/ref.cpp:539:24: warning: comparison between two arrays is deprecated in C++20 [-Warray-compare]
  539 |     if (r1.field_index != r2.field_index)
      |         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
../src/preproc/refer/ref.cpp:539:24: note: use unary '+' which decays operands to pointers or '&'component_ref' not supported by dump_decl<declaration error>[0] != &'component_ref' not supported by dump_decl<declaration error>[0]' to compare the addresses
  CXX      src/preproc/refer/refer-refer.o


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-01 gbranden Severity3 - Normal 2 - Minor
        StatusNeed Info None
    2022-05-30 gbranden StatusNone Need Info
    2022-05-30 gbranden CategoryCore Preprocessor refer

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code