Re : Underscores as prefixes/suffixes

Ok, I understand your point.

Julien

----- Message d’origine ----De : KHMan
? : A list for developers using the SDL library. (includes SDL-announce)
Envoy? le : Mercredi, 18 Juin 2008, 13h50mn 15s
Objet : Re: [SDL] Underscores as prefixes/suffixes

julien CLEMENT wrote:

Hello again,

Well I’ve discussed that problem of underscores with some other developers,
and they think, like me, that it should not be a problem to use
underscores in this way.
I’m used to prefix static functions with a double underscore, even
private members of
C++ classes (or Java classes as well).
I’m dubious about the fact that using underscores as prefixes and
suffixes of functions/variables/fields
should collide in any way with the compiler. It generates random
suffixes for its internal strings,
I doubt there is a probability to be in conflict with it.

I’m not an expert, just echoing Ulrich Eckhardt’s opinion. You can
see the reason behind our view by downloading the ISO C draft,
say, version n1256 (it’s probably n1256.pdf, something like that)
and see section 7.1.3, page 178, on “Reserved identifiers”. This
section is with respect to standard libraries provided by a C
implementation.

Obviously, you can ignore ISO C and things will still be just fine
if no identifiers collide now or in the future.


Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  _____________________________________________________________________________ 

Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

julien CLEMENT wrote:

Ok, I understand your point.

I only just took a look at the header file from the link in the
earlier post, and it looks like only the sentinel uses the
underscore. I agree that it’s highly unlikely it will clash with a
future C thingy, but I usually lean towards conservative
engineering, and in any case it has no effect on performance. It
has occurred to me that such a use of an underscored identifier
just might raise a warning if a user of your library runs it past
a C lint tool.> Julien

----- Message d’origine ----
De : KHMan <@Kein-Hong_Man>
? : A list for developers using the SDL library. (includes SDL-announce)

Envoy? le : Mercredi, 18 Juin 2008, 13h50mn 15s
Objet : Re: [SDL] Underscores as prefixes/suffixes

julien CLEMENT wrote:

Hello again,

Well I’ve discussed that problem of underscores with some other
developers,
and they think, like me, that it should not be a problem to use
underscores in this way.
I’m used to prefix static functions with a double underscore, even
private members of
C++ classes (or Java classes as well).
I’m dubious about the fact that using underscores as prefixes and
suffixes of functions/variables/fields
should collide in any way with the compiler. It generates random
suffixes for its internal strings,
I doubt there is a probability to be in conflict with it.

I’m not an expert, just echoing Ulrich Eckhardt’s opinion. You can
see the reason behind our view by downloading the ISO C draft,
say, version n1256 (it’s probably n1256.pdf, something like that)
and see section 7.1.3, page 178, on “Reserved identifiers”. This
section is with respect to standard libraries provided by a C
implementation.

Obviously, you can ignore ISO C and things will still be just fine
if no identifiers collide now or in the future.


Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

I’ve followed your advice, you have a good reason for
telling me this remark. The names of the functions are now
simplified and prefixed “SDLayer” instead of “SDL”.
By the way, the struct definition is simplified to:

typedef struct {
/*** Content ***/
} SDLayer_Display;

which solves the problem :slight_smile:

Cheers

Julien

----- Message d’origine ----De : KHMan
? : A list for developers using the SDL library. (includes SDL-announce)
Envoy? le : Mercredi, 18 Juin 2008, 16h49mn 23s
Objet : Re: [SDL] Re : Underscores as prefixes/suffixes

julien CLEMENT wrote:

Ok, I understand your point.

I only just took a look at the header file from the link in the
earlier post, and it looks like only the sentinel uses the
underscore. I agree that it’s highly unlikely it will clash with a
future C thingy, but I usually lean towards conservative
engineering, and in any case it has no effect on performance. It
has occurred to me that such a use of an underscored identifier
just might raise a warning if a user of your library runs it past
a C lint tool.

Julien

----- Message d’origine ----
De : KHMan
? : A list for developers using the SDL library. (includes SDL-announce)

Envoy? le : Mercredi, 18 Juin 2008, 13h50mn 15s
Objet : Re: [SDL] Underscores as prefixes/suffixes

julien CLEMENT wrote:

Hello again,

Well I’ve discussed that problem of underscores with some other
developers,
and they think, like me, that it should not be a problem to use
underscores in this way.
I’m used to prefix static functions with a double underscore, even
private members of
C++ classes (or Java classes as well).
I’m dubious about the fact that using underscores as prefixes and
suffixes of functions/variables/fields
should collide in any way with the compiler. It generates random
suffixes for its internal strings,
I doubt there is a probability to be in conflict with it.

I’m not an expert, just echoing Ulrich Eckhardt’s opinion. You can
see the reason behind our view by downloading the ISO C draft,
say, version n1256 (it’s probably n1256.pdf, something like that)
and see section 7.1.3, page 178, on “Reserved identifiers”. This
section is with respect to standard libraries provided by a C
implementation.

Obviously, you can ignore ISO C and things will still be just fine
if no identifiers collide now or in the future.


Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  _____________________________________________________________________________ 

Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr