bugCompact Disc Input and Control Library - Bugs: bug #35745, CERT Secure coding reserved...

 
 

bug #35745: CERT Secure coding reserved identifier recommendation

Submitter:  Markus Elfring <elfring>
Submitted:  Wed 07 Mar 2012 04:55:54 PM UTC
   
 
Category:  API Severity:  1 - Low
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  rocky
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 18 Mar 2012 06:15:04 PM UTC, comment #10: 

This bug report is not completely fixed with your commit "More small header changes" because I find that there are still open issues for standard-compliance.

  • Symbols like "__CDIO_CONFIG_H__"
  • Suffix "_t"
Markus Elfring <elfring>
Sun 18 Mar 2012 05:29:35 PM UTC, comment #9: 

The latest patches have been applied with modification.

Rocky Bernstein <rocky>
Group administrator
Fri 16 Mar 2012 12:55:06 PM UTC, comment #8: 

Would you also like to apply the next source code adjustment?

(file #25376)

Markus Elfring <elfring>
Fri 16 Mar 2012 11:51:58 AM UTC, comment #7: 

I find that you closed this bug report too early.
Can you accept the next attachment?

(file #25373)

Markus Elfring <elfring>
Wed 14 Mar 2012 03:07:45 AM UTC, comment #6: 

It doesn't look like you are able to produce a patch that is consistent with the libcdio philosophy: producing readable programmer-friendly code. 

I appreciate where CERT and POSIX standards guidlines are coming from. The are setting margins in anticipation of problems that currently don't exist with those specific names used. And these are just guidelines. 

If and when there is a real (as opposed to imagined) clash, we can deal with the situation then. At present this is not worth my effort; and it appears you are unable to provide a useful patch by following the suggestions given.

Rocky Bernstein <rocky>
Group administrator
Tue 13 Mar 2012 09:47:56 PM UTC, comment #5: 

I find that the added suffix is needed to make all include guards
really unique. These identifiers do not need to be pretty.

If you want to transform source files into a standard-compliant and safe format, the shown changes and more will be needed.

How do you think about answers to a question like "What style to use when naming types in C"?

Markus Elfring <elfring>
Tue 13 Mar 2012 02:33:19 PM UTC, comment #4: 

Te attached patch removes leading underscores, following CERT Secure Coding Standards guidelines, However it also adds a 32-character hex string to the end not advocated in the citation.
From the libcdio programmers' standpoint, that hex string appended makes the code ugly so please remove them.

libcdio code is written for as much for people to read as it is for computers to execute.

Two other things to note. There are comments at the end of the headers which refer to pre-processor name. Those should be changed as well. Second _CDIO_H_ is currently used outside of libcdio. So the name _CDIO_H_ will remain.

As for the _t suffix, I don't see any problem.

Rocky Bernstein <rocky>
Group administrator
Mon 12 Mar 2012 10:35:09 AM UTC, comment #3: 

Does the suffix "_t" in your data type definitions conflict with the POSIX name space specification?

Markus Elfring <elfring>
Sun 11 Mar 2012 05:39:21 PM UTC, comment #2: 

Would you like to integrate the attachment into your source repository?

(file #25325)

Markus Elfring <elfring>
Wed 07 Mar 2012 06:30:47 PM UTC, comment #1: 

Please submit a patch for this.

Rocky Bernstein <rocky>
Group administrator
Wed 07 Mar 2012 04:55:54 PM UTC, original submission:  

I suggest to try the search pattern "\<_(?:(?:_(.*))|([A-Z]+))" on source files.
Some places will be found where names begin with two underscores or an underscore and an uppercase letter.

Examples:


This usage does not fit to the expected naming conventions of the C language standard.
I recommend to adjust your selection for unique names.

Markus Elfring <elfring>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25325:  0001-Bug-35745-Unique-names-for-include-guards.patch added by elfring (15KiB - text/x-patch - update suggestion)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rocky (Posted a comment)
  • -email is unavailable- added by elfring (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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-18 rocky Open/ClosedOpen Closed
    2012-03-18 rocky StatusWont Fix Fixed
        Open/ClosedClosed Open
        Summaryreserved identifier violation CERT Secure coding reserved identifier recommendation
    2012-03-16 elfring Attached File- Added 0001-Bug-35745-Make-a-configuration-symbol-standard-compl.patch, #25376
    2012-03-16 elfring Attached File- Added 0001-Bug-35745-Make-include-guards-standard-compliant.patch, #25373
    2012-03-14 rocky StatusPostponed Wont Fix
        Open/ClosedOpen Closed
    2012-03-13 rocky Assigned toNone rocky
    2012-03-11 elfring Attached File- Added 0001-Bug-35745-Unique-names-for-include-guards.patch, #25325
    2012-03-11 rocky Severity5 - Average 1 - Low
        StatusNone Postponed

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code