bugGNU Scientific Library - Bugs: bug #36197, reserved identifier violation


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

bug #36197: reserved identifier violation

Submitted by:  Markus Elfring <elfring>
Submitted on:  Sun Apr 15 16:11:38 2012  
Category: BuildSeverity: 3 - Normal
Operating System: Status: None
Assigned to: NoneOpen/Closed: Open

(Jump to the original submission Jump to the original submission)

Sat Mar 5 19:23:24 2016, comment #6:

For completeness, here is a bunch of further reserved
identifiers being used. (errno.h reserves these as per
C99 Section 7.5)

#define ETA_POS_TABLE_NMAX 100
#define EVAL_RESULT(fn) \
#define EVAL_DOUBLE(fn) \
#define EXPAND(x) STRING(x)
#define NAME(x) EXPAND(TYPE(x))
#define ELEMENT(a,stride,i) ((a)[(stride)*(i)])
#define ERR(i) sqrt(gsl_matrix_get(covar,i,i))
#define EXTRA 10
#define EVAL(f,x) ((*((f)->function))(x,(f)->params))
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1

M Welinder <terra>
Sun Jun 3 09:14:39 2012, comment #5:

Appending a UUID would definitely reduce the probability of name clashes. However, we don't seem to have a name clash problem given that there are no outstanding bugs from name clashes and GSL is more than 16 years old.

Rhys Ulerich <rhysu>
Project Administrator
Sun Jun 3 08:44:48 2012, comment #4:

How do you think about to append a kind of UUID to your include guards so that the probability for name clashes can be reduced a bit more?

Markus Elfring <elfring>
Sun Jun 3 01:19:50 2012, comment #3:

Thanks for the clarification.

So, the double include #defines can be fixed. Changing the long-standing public APIs isn't an option as it would break existing users. Unfortunately it's an old set of decisions that are irreversible at this time.

Unless you object, I'd like to consider "fixing" this bug to be simply changing "__GSL" to "GSL" in the double inclusion guards.

Rhys Ulerich <rhysu>
Project Administrator
Sat Jun 2 21:10:29 2012, comment #2:

I suggest to be more careful with the use of double underscores for identifiers in your source files.

Would you also like to clarify the interpretation of the word "and" in the referenced paragraph?

Markus Elfring <elfring>
Sat Jun 2 17:35:19 2012, comment #1:

I agree that "__GSL_MATH_H_" is problematic according to the link you sent. That fix is just a judicious 'perl -pi -e' invocation across the code base and should be doable.

At a glance, I'm uncertain why "gsl_mode_t" and "gsl_prec_t" tamper with the POSIX name space. I see the "ANY header" table entry in the specification you linked. It seems the clause "End in the string indicated as a reserved suffix in the table and do not use the reserved prefixes posix_, POSIX_, or POSIX, as long as the reserved suffix is in that part of the name considered significant by the implementation." may prevent "gsl_mode_t" from being problematic, e.g., because it does not have a posix-y prefix.

Regardless, changing the GSL types ending with a "_t" would break the existing public APIs. I don't think this part of your report is fixable.

Rhys Ulerich <rhysu>
Project Administrator
Sun Apr 15 16:11:38 2012, original submission:

I would like to point out that an identifier like "_GSL_MATH_H_" does not fit to the expected naming convention of the C++ language standard.

Identifiers like "gsl_mode_t" and "gsl_prec_t" tamper with the POSIX name space.

Would you like to adjust your selection for unique names?

Markus Elfring <elfring>


Attached Files
file #27727:  36197a.diff added by elfring (118kB - application/octet-stream - Would you like to integrate these adjustments into your source file repository?)
file #27728:  36197b.diff added by elfring (180kB - application/octet-stream - Would you like to integrate these adjustments into your source file repository?)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by terra (Posted a comment)
  • -unavailable- added by rhysu (Posted a comment)
  • -unavailable- added by elfring (Submitted the item)

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



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Mar 30 21:35:37 2013elfringAttached File-=>Added 36197a.diff, #27727
      Attached File-=>Added 36197b.diff, #27728

    Back to the top

    Powered by Savane 3.1-cleanup