[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51565] Use nullptr rather than 0 in C++11 cod

From: Rik
Subject: [Octave-bug-tracker] [bug #51565] Use nullptr rather than 0 in C++11 code
Date: Mon, 24 Jul 2017 16:52:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0


                 Summary: Use nullptr rather than 0 in C++11 code
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Mon 24 Jul 2017 01:52:38 PM PDT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Other
                  Status: In Progress
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any



In C++11 programmer's can use 'nullptr' rather than 0, or the macro NULL, to
indicate an invalid pointer.  This has better type safety, and it is clearer
what the programmer meant.

It would be good to convert Octave's use of 0 to nullptr.  GCC 7 has a new
warning option, -Wzero-as-null-pointer-constant, which helps find instances of
0 which could be converted.  The documentation is

-Wzero-as-null-pointer-constant (C++ and Objective-C++ only)
Warn when a literal ‘0’ is used as null pointer constant. This can be
useful to
facilitate the conversion to nullptr in C++11.

I do not have access to GCC 7 so I am posting this bug report and request. 
Could someone (Dmitri?) set CXXFLAGS to include
-Wzero-as-null-pointer-constant and then re-compile all of Octave while saving
the compile log?  If you upload the log I can then take care of changing the


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]