bugGNU nano - Bugs: bug #58861, warnings when compiling with GCC...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58861: warnings when compiling with GCC 10.1.0

Submitter:  Michalis Kokologiannakis <michalis>
Submitted:  Fri 31 Jul 2020 08:48:34 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 13 Aug 2020 05:05:34 AM UTC, comment #3: 

Released in 5.1.  Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Sun 02 Aug 2020 02:53:38 PM UTC, comment #2: 

Verified, and pushed to master in commit 4940b02a.

Benno Schulenberg <bens>
Group administrator
Fri 31 Jul 2020 05:15:18 PM UTC, comment #1: 

Thanks for the patch.  I will verify it when I fire up the Manjaro machine again, in a couple of days.

Benno Schulenberg <bens>
Group administrator
Fri 31 Jul 2020 08:48:34 AM UTC, original submission:  

Issuing a default build as follows


./autogen.sh
./configure
make


results in a couple of stringop-truncation warnings at the measured_copy() function in utils.c:333 when compiling with GCC 10.1.0 and -O2 -Wall.

Since the point of measured_copy() is to both truncate its argument and null-terminate it, memcpy() can be used instead of strncopy(). When using the former, GCC does not produce any warnings (see attached patch).

Michalis Kokologiannakis <michalis>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by michalis (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-13 bens Open/ClosedOpen Closed
    2020-08-02 bens StatusNone Fixed
    2020-07-31 bens Severity3 - Normal 2 - Minor
        Assigned toNone bens
        SummaryCompilation warnings when compiling with GCC 10.1.0 warnings when compiling with GCC 10.1.0
    2020-07-31 michalis Attached File- Added 0001-utils-Use-memcpy-instead-of-strncpy-in-measured_copy.patch, #49590

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code