Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2022-10-07 05:08 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (29 votes). Check out past polls.