bugPSPP - Bugs: bug #52045, pc+-file-reader.c: Wrong usage of...

 
 

bug #52045: pc+-file-reader.c: Wrong usage of pcp_error

Submitter:  Friedrich Beckmann <beckmanf>
Submitted:  Sat 16 Sep 2017 12:41:52 PM UTC
   
 
Category:  System/Portable File I/O Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 23 Sep 2017 05:49:09 PM UTC, comment #2: 

Thanks for the report.  I fixed this bug and several other warnings issued by Clang.

Ben Pfaff <blp>
Group administrator
Sat 16 Sep 2017 12:47:52 PM UTC, comment #1: 

Same problem for:


../pspp/src/data/sys-file-reader.c:3507:18: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct sfm_reader *' [-Wnon-literal-null-conversion]
      sys_error (ME, 0, _("%s: stat failed (%s)."),
                 ^~
1 warning generated.


Friedrich Beckmann <beckmanf>
Group Member
Sat 16 Sep 2017 12:41:52 PM UTC, original submission:  

I get the following warning when compiling pspp on MacOS with clang:


../pspp/src/data/pc+-file-reader.c:224:18: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct pcp_reader *' [-Wnon-literal-null-conversion]
      pcp_error (ME, 0, _("%s: stat failed (%s)."),
                 ^~
../pspp/src/data/pc+-file-reader.c:230:18: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct pcp_reader *' [-Wnon-literal-null-conversion]
      pcp_error (ME, 0, _("%s: file too large."), fh_get_file_name (r->fh));
                 ^~
2 warnings generated.


The first argument of pcp_error should be a pointer but not a message type. I think it should be replaced with msg but I am not sure.

Friedrich Beckmann <beckmanf>
Group Member

 

(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 blp (Posted a comment)
  • -email is unavailable- added by beckmanf (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-23 blp StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2017-09-23 beckmanf StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code