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

 
 

bug #35745: CERT Secure coding reserved identifier recommendation

Submitted by:  Markus Elfring <elfring>
Submitted on:  Wed 07 Mar 2012 04:55:54 PM UTC  
 
Category: APISeverity: 1 - Low
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Rocky Bernstein <rocky>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by rocky (Posted a comment)
  • -unavailable- added by elfring (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 18 Mar 2012 05:56:46 PM UTCrockyOpen/ClosedOpen=>Closed
    Sun 18 Mar 2012 05:29:35 PM UTCrockyStatusWont Fix=>Fixed
      Open/ClosedClosed=>Open
      Summaryreserved identifier violation=>CERT Secure coding reserved identifier recommendation
    Fri 16 Mar 2012 12:55:06 PM UTCelfringAttached File-=>Added 0001-Bug-35745-Make-a-configuration-symbol-standard-compl.patch, #25376
    Fri 16 Mar 2012 11:51:58 AM UTCelfringAttached File-=>Added 0001-Bug-35745-Make-include-guards-standard-compliant.patch, #25373
    Wed 14 Mar 2012 03:07:45 AM UTCrockyStatusPostponed=>Wont Fix
      Open/ClosedOpen=>Closed
    Tue 13 Mar 2012 02:33:19 PM UTCrockyAssigned toNone=>rocky
    Sun 11 Mar 2012 05:39:21 PM UTCelfringAttached File-=>Added 0001-Bug-35745-Unique-names-for-include-guards.patch, #25325
    Sun 11 Mar 2012 10:46:34 AM UTCrockySeverity5 - Average=>1 - Low
      StatusNone=>Postponed

    Back to the top


    Powered by Savane 3.1-cleanup1