Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: OT (Zaxo) C Standard (was Rex2: Blowfish using Inline::C)

by wog (Curate)
on Jan 26, 2002 at 20:51 UTC ( #141792=note: print w/ replies, xml ) Need Help??


in reply to OT (Zaxo) C Standard (was Rex2: Blowfish using Inline::C)
in thread Blowfish using Inline::C

One of those is that identifiers beginning with a single underscore have file scope. Effectively, they are private methods..

Note that the standard is referring to header files. I think that this means a header file can do something like:

static int _foo(void) { /* ... do stuff ... */ }
or like
struct _bar { /* ... */ };
or like
static int _baz;
(update: Of course, it's important to note that these definitions could be referred to in macros so "overriding" them, even if possible, would make code below the overriding not work.) And when you use XS (or Inline since that uses XS) you are probably indirectly using standard header files. So, if you use these names and the header files, you can have a serious problem with duplicated function names and such.

Also note the first bullet under 7.1.3 paragraph(?) 1. "All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use." This seems to mean that the C library may do weird things with those names. Take my C library implementation (glibc), for example. It defines numerous identifiers beginning with _IO for implementing stdio. Some of these even have external linkage, so if you use them with in a program, you could have conflicts linking in libc even if you never use the relevant header files. The standard seems to say the implementation need not worry about creating problems like this even for functions names like _Start or _Crypt.


Comment on Re: OT (Zaxo) C Standard (was Rex2: Blowfish using Inline::C)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://141792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-12-26 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (164 votes), past polls