f



Why sizeof(main) = 1?

Hi,

On a Linux system with gcc, I am just wondering why sizeof(main) can
be 1 or sizeof when applied on any function name can yield 1 ever? Or
is it only gcc's perspective to say sizeof of an implicit function
pointer to be 1 since it gives sizeof(void) to be 1 based on the
backward compatibility with the pre C99 notion that void* had its
predecessor char* and usually sizeof(char) being 1?

Also, I tried the invariably buggy code to see if at all sizeof(main)
= 1 can be realized.

/* Keep the warnings aside for a minute, please! */
#include <stdio.h>

int main(void)
{
        printf("sizeof(char) : %zd\n", sizeof(char));
        printf("sizeof(main) : %zd\n", sizeof(main));

        char p = main; // Truncates into only one byte of the bytes
required to hold
                              // main's address - known bug. But just
to see sizeof(main) = 1 if at all makes any sense.

        ((int (*)(void))p)(); // Known to be buggy and wrong.

        return 0;
}

Any explanation is cheerful. :)

Cheers.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Myth__Buster
1/5/2013 12:14:52 AM
comp.lang.c.moderated 1019 articles. 1 followers. Post Follow

13 Replies
354 Views

Similar Articles

[PageSpeed] 27

On Fri, 4 Jan 2013 18:14:52 -0600 (CST), Myth__Buster
<raghavanil4m@gmail.com> wrote:

>Hi,
>
>On a Linux system with gcc, I am just wondering why sizeof(main) can
>be 1 or sizeof when applied on any function name can yield 1 ever? Or
>is it only gcc's perspective to say sizeof of an implicit function
>pointer to be 1 since it gives sizeof(void) to be 1 based on the
>backward compatibility with the pre C99 notion that void* had its
>predecessor char* and usually sizeof(char) being 1?

sizeof(char) is always 1, not just usually.  Why do you think
sizeof(char) being 1 has any effect on sizeof(void*) or sizeof(char*)?

>Also, I tried the invariably buggy code to see if at all sizeof(main)
>= 1 can be realized.
>
>/* Keep the warnings aside for a minute, please! */
>#include <stdio.h>
>
>int main(void)
>{
>        printf("sizeof(char) : %zd\n", sizeof(char));
>        printf("sizeof(main) : %zd\n", sizeof(main));

This second argument contains a constraint violation and therefore
requires a diagnostic.  (The sizeof operator cannot be applied to an
expression of type function.)  After that, there is no correct result
so 1 is as good as any other value.

>        char p = main; // Truncates into only one byte of the bytes

This assignment also contains a constraint violation and requires a
diagnostic.   (There is no implicit conversion from function pointer
to char.)

>required to hold
>                              // main's address - known bug. But just
>to see sizeof(main) = 1 if at all makes any sense.
>
>        ((int (*)(void))p)(); // Known to be buggy and wrong.

This is a syntactically valid statement but since the value in p does
not actually point to a function, once the statement executes you have
undefined behavior.

>        return 0;
>}
>
>Any explanation is cheerful. :)

Step outside the language and get strange results.  Why are you
surprised?

-- 
Remove del for email
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Barry
2/26/2013 4:51:20 PM
On 2013-01-05, Myth__Buster <raghavanil4m@gmail.com> wrote:
> Hi,
>
> On a Linux system with gcc, I am just wondering why sizeof(main) can
> be 1 or sizeof when applied on any function name can yield 1 ever? Or
> is it only gcc's perspective to say sizeof of an implicit function
> pointer to be 1 since it gives sizeof(void) to be 1 based on the
> backward compatibility with the pre C99 notion that void* had its
> predecessor char* and usually sizeof(char) being 1?

1 seems as good as any other value,  

> Any explanation is cheerful. :)

C99 6.5.3.4.1 forbids using sizeof with a function type, but does not
require a dignostic (error or warning) from the compiler if it is
attempted.


-- 
⚂⚃ 100% natural

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Jasen
2/26/2013 4:51:25 PM
> On a Linux system with gcc, I am just wondering why sizeof(main) can
> be 1 or sizeof when applied on any function name can yield 1 ever? Or

I would prefer that sizeof(a_function_name) be 0/0 .  Or, for systems
with integer NaNs, (0/0)/(0/0) .

Another value that would make sense is the size of a function pointer
(which is rarely 1) since the use of main in an expression decays
into a function pointer type.  If you depend on a particular value
in this situation, you get what you deserve.

sizeof() is not defined on a function type (function *pointers*, yes,
function type, no).

> is it only gcc's perspective to say sizeof of an implicit function
> pointer to be 1 since it gives sizeof(void) to be 1 based on the
> backward compatibility with the pre C99 notion that void* had its
> predecessor char* and usually sizeof(char) being 1?

sizeof(char) is defined as being 1 by the C standard.  That should
make sizeof(char) == 1 more often than "usually" for much the same
reason that 2 + 2 usually equals 4 when calculating with ints.  I
don't see the backwards compatability issue, but it may have been
more important 20 years ago and from then on it's done for compatability
with previous versions of gcc.

> Also, I tried the invariably buggy code to see if at all sizeof(main)
> = 1 can be realized.
> 
> /* Keep the warnings aside for a minute, please! */
> #include <stdio.h>
> 
> int main(void)
> {
>        printf("sizeof(char) : %zd\n", sizeof(char));
>        printf("sizeof(main) : %zd\n", sizeof(main));
> 
>        char p = main; // Truncates into only one byte of the bytes
> required to hold
>                              // main's address - known bug. But just

If you mean known bug *with this example*, fine.  If you mean known
bug in a particular compiler, I don't see it.

> to see sizeof(main) = 1 if at all makes any sense.
> 
>        ((int (*)(void))p)(); // Known to be buggy and wrong.
> 
>        return 0;
> }
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
gordonb
2/26/2013 4:51:34 PM
Barry Schwarz <schwarzb@dqel.com> writes:
> On Fri, 4 Jan 2013 18:14:52 -0600 (CST), Myth__Buster
> <raghavanil4m@gmail.com> wrote:
>>On a Linux system with gcc, I am just wondering why sizeof(main) can
>>be 1 or sizeof when applied on any function name can yield 1 ever? Or
>>is it only gcc's perspective to say sizeof of an implicit function
>>pointer to be 1 since it gives sizeof(void) to be 1 based on the
>>backward compatibility with the pre C99 notion that void* had its
>>predecessor char* and usually sizeof(char) being 1?
>
> sizeof(char) is always 1, not just usually.  Why do you think
> sizeof(char) being 1 has any effect on sizeof(void*) or sizeof(char*)?
>
>>Also, I tried the invariably buggy code to see if at all sizeof(main)
>>= 1 can be realized.
>>
>>/* Keep the warnings aside for a minute, please! */
>>#include <stdio.h>
>>
>>int main(void)
>>{
>>        printf("sizeof(char) : %zd\n", sizeof(char));
>>        printf("sizeof(main) : %zd\n", sizeof(main));
>
> This second argument contains a constraint violation and therefore
> requires a diagnostic.  (The sizeof operator cannot be applied to an
> expression of type function.)  After that, there is no correct result
> so 1 is as good as any other value.
[...]

I can't see the parent article, which was probably posted some time ago,
with responses appearnig only now because comp.lang.c.moderated tends to
have a rather long latency.  Quite possibly the answer has already been
posted, but I don't see it here, so ...

gcc supports arithmetic on void* and on pointer-to-function types as a
language extension.  In standard C, any attempt to perform pointer
arithmetic on a function pointer or on a pointer to an incomplete type
(such as void*) is a constraint violation, requiring a diagnostic.

gcc is *not* a conforming compiler by default.  If you provide the right
command-line options (something like "-std=cXX -pedantic", where XX can
be 89, 99, or 11), then it attempt to be conforming and will warn about
such things.

But wait, you're not performing pointer arithmetic, so why does this
matter?  C defines pointer arithmetic in terms of the size of the
poitner's referenced type.  The expression `main` is of
pointer-to-function type in this context.  The gcc developers decided to
make `sizeof main` 1; the behavior of pointer arithmitec on a
pointer-to-function type follows from that.  So `main + 1` is a function
pointer that points one byte *after* the address of the main function.

But only in GNU C; in standard C `main + 1` is nonsense.

IMHO this gcc extension provides a very small amount of convenience for
non-portable code at the expense of a great deal of confusion.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Keith
3/11/2013 11:25:37 PM
(sizeof main == 1) because (main) is treated as a logical value.  Compare: 
{ if (main) yadda; }

Użytkownik "Myth__Buster"  napisał w wiadomości grup 
dyskusyjnych:clcm-20130104-0002@plethora.net...

Hi,

On a Linux system with gcc, I am just wondering why sizeof(main) can
be 1 or sizeof when applied on any function name can yield 1 ever? Or
is it only gcc's perspective to say sizeof of an implicit function
pointer to be 1 since it gives sizeof(void) to be 1 based on the
backward compatibility with the pre C99 notion that void* had its
predecessor char* and usually sizeof(char) being 1?

Also, I tried the invariably buggy code to see if at all sizeof(main)
= 1 can be realized.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
kzelechowski
9/2/2013 9:07:56 AM
On 09/02/2013 05:07 AM, kzelechowski@e3tech.local wrote:
> (sizeof main == 1) because (main) is treated as a logical value.  Compare: 
> { if (main) yadda; }

Why are you resurrecting a thread that started eight months ago, and was
completely resolved six months ago?

The behavior of an if() statement depends upon whether the if-condition
compares equal to 0. You could think of if(main) as if it evaluates
main==0, though that's not how the C standard describes it. You might
think that an equality comparison expression should have "a logical
value" - but this is C, and as originally designed, C didn't have have a
logical type (_Bool was a late addition, in C99). In C the expression
main==0 has the type 'int'  It's possible that sizeof(int)==1, but it's
not exactly common. For that matter, the standard doesn't say anything
about sizeof(_Bool), either; it could be > 1.

The if(main) example relies upon the fact that "... a function
designator with type ‘‘function returning type’’ is converted to an
expression that has type ‘‘pointer to function returning type’’."
(6.3.2.1p4). However, the "..." in the above citation represents the
following words: "Except when it is the operand of the sizeof operator,
the _Alignof operator,65) or the unary & operator, ...". Therefore, no
such conversion occurs in the sizeof expression (this is from n1570.pdf,
the final draft of C2011 - I think _Alignof may have been removed from
that sentence in the actual standard).
In fact, such code violates a constraint: "The sizeof operator shall not
be applied to an expression that has function type, ..." (6.5.3.4p1)

I you had bothered to read Jason Betts' response, you would already be
aware of (6.5.3.4p1). He said that it "... does not require a dignostic
....", but I'm afraid that's true only because he misspelled diagnostic.
6.5.3.4 is a Constaints* section. At least one diagnostic is required
for any program that violates a constraint.

* - spelling complaints are required to contain at least one spelling
mistake.
-- 
James Kuyper
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
James
9/7/2013 4:25:06 AM
<kzelechowski@e3tech.local> writes:
> (sizeof main == 1) because (main) is treated as a logical value.  Compare: 
> { if (main) yadda; }

No, that's not the reason.

Consider that an `int` can also be treated as a logical value;
`if (1)` is valid, but `sizeof 1` is the same as `sizeof (int)`,
which is rarely 1.

The expression `main`, or any function name, is implicitly converted,
in most contexts, to a pointer whose type depends on how you declared
and/or defined the function.

Any pointer value can be used as a condition; it's implicitly
checked for inequality to 0, i.e., to the null pointer.

    if (main) yadda;

is well defined but not useful, since `main`, after conversion,
can never be a null pointer.

But when it's the argument of `&` or `sizeof`, this implicit
conversion doesn't happen.  `&main` gives you the address of the
`main` function, just like `main` by itself does.  `sizeof main`
*would* be the size of a function, but there is no such concept in C,
so it's a constraint violation, requiring a diagnostic.

> Użytkownik "Myth__Buster"  napisał w wiadomości grup 
> dyskusyjnych:clcm-20130104-0002@plethora.net...
>
> On a Linux system with gcc, I am just wondering why sizeof(main) can
> be 1 or sizeof when applied on any function name can yield 1 ever? Or
> is it only gcc's perspective to say sizeof of an implicit function
> pointer to be 1 since it gives sizeof(void) to be 1 based on the
> backward compatibility with the pre C99 notion that void* had its
> predecessor char* and usually sizeof(char) being 1?
>
> Also, I tried the invariably buggy code to see if at all sizeof(main)
> = 1 can be realized.

I think you mean pre C89 or pre-C90.  C89/C90 introduced the `void`
keyword and the `void*` pointer type; C99 didn't make any real
changes in that area.  But this has nothing to do with backward
compatibility; the same standard that introduced the `void` keyword
and type also prohibited applying `sizeof` to it.

(And `sizeof (char) == 1` by definition.)

`sizeof main == 1` because of a gcc extension.  Standard C does
not permit pointer arithmetic on void* or on function pointers.
Gcc permits both, and specifies that, for example, adding 1 to a
void* or function pointer advances it by one byte (like adding 1 to
a char*).  The authors of gcc chose to implement this by pretending
that the size of the type `void`, and the size of any function type,
is 1 (neither has a defined size in standard C).

I can see that pointer arithmetic on `void*` might be convenient in
some cases.  The usefulness of arithmetic on function pointers is
less obvious, but I suppose it could have its uses.  It's a pity
that implementing such arithmetic had the size effect of making
both `sizeof (void)` and `sizeof main` equal to 1; both results
are nonsensical.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Keith
9/7/2013 4:25:44 AM
On 9/2/2013 5:07 AM, kzelechowski@e3tech.local wrote:
> (sizeof main == 1) because (main) is treated as a logical value.  Compare: {
> if (main) yadda; }

No, it is 1 because gcc has decided that, as an extension to the C standard, 
it will allow sizeof to be applied to functions, and will be the value 1.

6.5.3.4p1 states:

     "The sizeof operator shall not be applied to an expression that has
     function type or an incomplete type, to the parenthesized name of
     such a type, or to an expression that designates a bit-field member."

I believe that the name of a function is an "expression that has function 
type".  (Though I'm sure I will be quickly corrected if I am mistaken.)

If I try compiling the following code:

====
extern void foo(void);
int x = (int)sizeof foo;
====

I get the error:

     'void (__cdecl *)(void)': illegal sizeof operand

>
> Użytkownik "Myth__Buster"  napisał w wiadomości grup
> dyskusyjnych:clcm-20130104-0002@plethora.net...
>
> Hi,
>
> On a Linux system with gcc, I am just wondering why sizeof(main) can
> be 1 or sizeof when applied on any function name can yield 1 ever? Or
> is it only gcc's perspective to say sizeof of an implicit function
> pointer to be 1 since it gives sizeof(void) to be 1 based on the
> backward compatibility with the pre C99 notion that void* had its
> predecessor char* and usually sizeof(char) being 1?
>
> Also, I tried the invariably buggy code to see if at all sizeof(main)
> = 1 can be realized.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Ken
9/7/2013 4:25:51 AM
James Kuyper <jameskuyper@verizon.net> writes:
> On 09/02/2013 05:07 AM, kzelechowski@e3tech.local wrote:
>> (sizeof main == 1) because (main) is treated as a logical value.  Compare: 
>> { if (main) yadda; }
>
> Why are you resurrecting a thread that started eight months ago, and was
> completely resolved six months ago?
>
> The behavior of an if() statement depends upon whether the if-condition
> compares equal to 0. You could think of if(main) as if it evaluates
> main==0, though that's not how the C standard describes it.

Or you could think of it as if it evaluates main!=0 -- which very nearly
is how the C standard describes it:

    In both forms [of the "if" statement], the first substatement is
    executed if the expression compares unequal to 0

Since the expression main decays to a pointer, the 0 is treated as a
null pointer constant and is converted to the same pointer type.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Keith
9/11/2013 10:26:47 PM
On Fri, 6 Sep 2013 23:25:44 -0500 (CDT), Keith Thompson
<kst-u@mib.org> wrote:

>The expression `main`, or any function name, is implicitly converted,
>in most contexts, to a pointer whose type depends on how you declared
>and/or defined the function.
>
>Any pointer value can be used as a condition; it's implicitly
>checked for inequality to 0, i.e., to the null pointer.
>
>    if (main) yadda;
>
>is well defined but not useful, since `main`, after conversion,
>can never be a null pointer.


Is that actually true?  Certainly any valid data-type object cannot
have an address of zero/NULL, but is that true of function objects?
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Robert
9/11/2013 10:27:31 PM
On 09/11/2013 06:26 PM, Keith Thompson wrote:
> James Kuyper <jameskuyper@verizon.net> writes:
>> On 09/02/2013 05:07 AM, kzelechowski@e3tech.local wrote:
>>> (sizeof main == 1) because (main) is treated as a logical value.  Compare: 
>>> { if (main) yadda; }
>>
>> Why are you resurrecting a thread that started eight months ago, and was
>> completely resolved six months ago?
>>
>> The behavior of an if() statement depends upon whether the if-condition
>> compares equal to 0. You could think of if(main) as if it evaluates
>> main==0, though that's not how the C standard describes it.
> 
> Or you could think of it as if it evaluates main!=0 -- which very nearly
> is how the C standard describes it:
> 
>     In both forms [of the "if" statement], the first substatement is
>     executed if the expression compares unequal to 0
> 
> Since the expression main decays to a pointer, the 0 is treated as a
> null pointer constant and is converted to the same pointer type.

My key point was that the description of the semantics of an if()
statement are not related to the rules governing the type of the result
of a comparison expression (whether it's an equality or inequality
expression is irrelevant to my point). Thus, connecting the value of
"sizeof main" to the semantics of if(main) is meaningless (and not just
for this reason - my full message gave other, more important reasons).
-- 
James Kuyper
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
James
9/12/2013 4:29:08 PM
On 09/11/2013 06:27 PM, Robert Wessel wrote:
> On Fri, 6 Sep 2013 23:25:44 -0500 (CDT), Keith Thompson
> <kst-u@mib.org> wrote:
....
>>    if (main) yadda;
>>
>> is well defined but not useful, since `main`, after conversion,
>> can never be a null pointer.
> 
> 
> Is that actually true?  Certainly any valid data-type object cannot
> have an address of zero/NULL, but is that true of function objects?

"a null pointer ... is guaranteed to compare unequal
to a pointer to any object or function." (6.3.2.3p3)
"Two pointers compare equal if ... both are null pointers." (6.5.9p6)
If a pointer to main were a null pointer, those two requirements would
be in conflict.
-- 
James Kuyper
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
James
9/12/2013 4:29:41 PM
Robert Wessel <robertwessel2@yahoo.com> writes:
> On Fri, 6 Sep 2013 23:25:44 -0500 (CDT), Keith Thompson
> <kst-u@mib.org> wrote:
>>The expression `main`, or any function name, is implicitly converted,
>>in most contexts, to a pointer whose type depends on how you declared
>>and/or defined the function.
>>
>>Any pointer value can be used as a condition; it's implicitly
>>checked for inequality to 0, i.e., to the null pointer.
>>
>>    if (main) yadda;
>>
>>is well defined but not useful, since `main`, after conversion,
>>can never be a null pointer.
>
> Is that actually true?  Certainly any valid data-type object cannot
> have an address of zero/NULL, but is that true of function objects?

Yes.  N1570 6.3.2.3p3 says that a null pointer is guaranteed to
compare unequal to a pointer to any object or function.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Keith
9/12/2013 4:30:18 PM
Reply:

Similar Artilces:

Why (eql #c(1 0) 1) but (not (eql #c(1.0 0.0) 1.0))?
Is there a deep reason--mathematical, implementational or otherwise--that numbers of type (complex float) can have a zero imaginary part while (complex rationals) can not? Or is it just one of those things? -Peter -- Peter Seibel peter@javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp Peter Seibel <peter@javamonkey.com> writes: > Is there a deep reason--mathematical, implementational or > otherwise--that numbers of type (complex float) can have a zero > imaginary part while (complex rationals) can not? Or is i...

Available Consultants( 2 Siebel, 1 Java, 1 C/C++ Unix, 1 Network Engineer)
Contact Sudin 402 218 2179 Email: sudin@kraftware.com Hi, We have the following 5 Consultants available, following are the details: Kindly let me know if you have any projects. 1) Ananda Y ( Siebel Adm and Copnfigurator) SUMMARY: " Overall 9+ years of total IT experience " 4+ year of experience on Siebel Server Administration , Configuration and Application Development " Dynamic, results oriented Team Player with extensive experience in Siebel Server Administration " Worked as Consultant ( Siebel) , Software Engineer (Siebel), Comput...

XHTML 1.1 spec: lang and xml:lang
Hello, I've looked at the latest XHTML spec from 2009-05-07. Referring to http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_commonatts In the I18N module, there are only two attributes listed: dir and xml:lang. The note in the last paragraph says: "Finally, note that the I18N collection only contains the xml:lang attribute unless the Bi- directional Text Module module is selected." This is fine, but... http://www.w3.org/TR/xhtml11/doctype.html says (last paragraph): "This specification also adds the lang attribute to the I18N attribute c...

d=(c=(b=a+1)+1)+1;
void foo() { int a=1,b,c,d; d=(c=(b=a+1)+1)+1; //2 } is the //2 line fully okay in c? (it works but im not 100% sure), what if some more complex expression would be build (where evealuation order means much) d=(c=(b=a+1)+b+1)+(a=1); or yet more complex etx Is this like calling expression where much are (probably unfortunately) not defined or all is (fortunatelly) defined here? fir <profesor.fir@gmail.com> writes: > void foo() > { > int a=1,b,c,d; > > d=(c=(b=a+1)+1)+1; //2 > } > > is the //2 line fully okay in c? Yes. ...

1 - 1, 1 -1, 1-1, 1
Hi, I have a question regarding lexical analysis. I recently came across a bug in our lexical analyser in phc (www.phpcompiler.org), that I am unsure how to solve. This is the problem: our current definition for integer constant looks something like INT ([1-9][0-9]*)|0 In particular, note that it does not allow for an (optional) "+" or "-" at the start of the integer. This means that the strings "1 - 1", "1 -1" and "1-1" all generate the same sequence of three tokens INT(1), OP(-), INT(1), for which the syntax analyser generates the subtr...

1.1.1.1 ?
hi my firewall logs dropped packets from an internal IP address trying to contact 1.1.1.1 through port 9999. Any ideas whether 1.1.1.1 is valid IP? and what is port 9999?? thanks mike wrote: > hi > > my firewall logs dropped packets from an internal IP address trying to > contact 1.1.1.1 through port 9999. Any ideas whether 1.1.1.1 is valid > IP? and what is port 9999?? > thanks These trojans *BlitzNet*, *Backdoor.Oracle*, *Backdoor.Spadeace* uses port 9999 -- S.S. "StarScripter" <Star@privacy.net> wrote in message news:<bv8ejj$p54t3$1@ID-185702.new...

C.7.6.3.1.4 Pixel Data and C.7.6.2.1.1 Image Position And Image Orientation
Dear All, How should I reconcile the definitions of image coordinates in the "Pixel Data" and "Image Position and Image Orientation" sections of the 2009 DICOM standard? "Pixel Data" says that the pixels are labelled: (1,1) (1,2) (1,3) (1,4) etc. (2,1) (2,2) (2,3) (2,4) etc. etc. i.e. (row starting at 1, column starting at 1) But the formula on the "Image Position And Image Orientation" section it say is said to determine "The mapping of pixel location (i, j)" but WHERE i Column index to the image plane. The fir...

GUI for Turbo C++ 1.01/OW 1.7 C++?
Simply, where do I download one? I want it for the VGA16 screen mode. ----------- Joseph Rose, a.k.a. Harry Potter Working magic in the computer community...or at least trying to! :( On Tue, 21 Jul 2009 09:40:40 -0700, Harry Potter wrote: > Simply, where do I download one? I want it for the VGA16 screen mode. Define "GUI". I think you mean something besides "GUI" - maybe IDE (Integrated Developent Environment), but the DOS IDE versions are not graphical - that pretty much takes an OS with a Graphical User Interface, something like Windows. -- T.E....

Creating a User Interface with c/c++ so as to be called by another C/C++main program
Hi!! I want to create a user interface for my controlling Console main program. I would like to create a library of function (.lib) which start a user interface in the same thread. I have heard something about MFC, but in some examples I have faund a .uir file which I don=B4t know how to generate. Thank you pableratz@gmail.com wrote: > Hi!! > > I want to create a user interface for my controlling Console main > program. I would like to create a library of function (.lib) which > start a user interface in the same thread. > > I have heard something about MFC, but in ...

VSPWorks v4.5.1 (c) Wind River, visualSTATE v5.0.7.88 (C) IAR, LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE, other ...
VSPWorks v4.5.1 (c) Wind River, visualSTATE v5.0.7.88 (C) IAR, LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE, other ... VSPWorks v4.5.1 (c) Wind River LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE RSV507A.ZIP 21851 09- 5-03 11| visualSTATE v5.0.7.88 (C) IAR [xx/08] Microcap 7.16, 8051.IDE.v1.20.WinALL, I-LOGIX_STATEMATE_V3.2, Tasking Debuggers, Compilers, IDE, Tools, Embedded Development Environment (EDE), CADENCE ORCAD UNISON SUITE PRO V10.0 - new !, Xilinx ISE 6.1i [2 CDs] - new !, PCB DESIGN STUDIO V15.0 *UPDATED* - CADENCE [2 CDs], Rhapsody v4.1 MR2 - I-Logix, CAM350 v7.6, EWB5.12C,...

VSPWorks v4.5.1 (c) Wind River, visualSTATE v5.0.7.88 (C) IAR, LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE, other ...
VSPWorks v4.5.1 (c) Wind River, visualSTATE v5.0.7.88 (C) IAR, LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE, other ... 05/Jan/2004 VSPWorks v4.5.1 (c) Wind River LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE RSV507A.ZIP 21851 09- 5-03 11| visualSTATE v5.0.7.88 (C) IAR [xx/08] Microcap 7.16, 8051.IDE.v1.20.WinALL, I-LOGIX_STATEMATE_V3.2, Tasking Debuggers, Compilers, IDE, Tools, Embedded Development Environment (EDE), CADENCE ORCAD UNISON SUITE PRO V10.0 - new !, Xilinx ISE 6.1i [2 CDs] - new !, PCB DESIGN STUDIO V15.0 *UPDATED* - CADENCE [2 CDs], Rhapsody v4.1 MR2 - I-Logix, CAM350 v...

VSPWorks v4.5.1 (c) Wind River, visualSTATE v5.0.7.88 (C) IAR, LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE, other
VSPWorks v4.5.1 (c) Wind River, visualSTATE v5.0.7.88 (C) IAR, LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE, other ... 05/Jan/2004 VSPWorks v4.5.1 (c) Wind River LOGIC DESIGN AND VERIFICATION V5.1 (c) CADENCE RSV507A.ZIP 21851 09- 5-03 11| visualSTATE v5.0.7.88 (C) IAR [xx/08] Microcap 7.16, 8051.IDE.v1.20.WinALL, I-LOGIX_STATEMATE_V3.2, Tasking Debuggers, Compilers, IDE, Tools, Embedded Development Environment (EDE), CADENCE ORCAD UNISON SUITE PRO V10.0 - new !, Xilinx ISE 6.1i [2 CDs] - new !, PCB DESIGN STUDIO V15.0 *UPDATED* - CADENCE [2 CDs], Rhapsody v4.1 MR2 - I-Lo...

Creating a User Interface with c/c++ so as to be called by another C/C++main program #2
Hi!! I want to create a user interface for my controlling Console main program. I would like to create a library of function (.lib) which start a user interface in the same thread. I have heard something about MFC, but in some examples I have faund a .uir file which I don=B4t know how to generate. Thank you ...

Web resources about - Why sizeof(main) = 1? - comp.lang.c.moderated

Fast inverse square root - Wikipedia, the free encyclopedia
, the reciprocal (or multiplicative inverse) of a square root for a 32-bit floating point number in IEEE 754 floating point format . The algorithm ...

Arduino - AllRecentChanges
Main.Buy . . . June 26, 2012, at 10:15 AM by Davide Gomba ? : Reference.SoftwareSerialRead . . . May 25, 2012, at 09:48 AM by Tom Igoe ? : T ...

13.8V 20A linear power supply
A simple conventional power supply with clever design

Artifacts in data (Abstract+Article)
From www.astrology-and-science.com Click here to return to home page Artifacts in data Often wrongly seen as evidence for astrology Geoffrey ...

BANKSHOT - Bankshot Basketball&#153 SPORTS
Bankshot Sports produces recreational systems that promote inclusionary and non-agressive sports. These sports systems are equally accessible ...

Operation Paraquat
Most People have heard of Britain's involvement in military conflicts in the later half of this century, such

Early History of Harvest Computer by Warren Alva Hunt
In 1956, while on the SAGE computer project and on sub assignment as aliaison to Gene Amdahl, I was asked by Steve Dunwell, a former associateof ...

Bullseye Testing Technology
The Authority in C++ Code Coverage Product Evaluate Download Purchase Support Company Contact Partners BullseyeCoverage is the leading C++ code ...

What are the differences between new and malloc?: C / C++ FAQs & Programming Resources - ProkutFAQ
C and C++ FAQs for beginner & intermediate programmers. Find answers for a wide range of topics including pointers, memory, functions, arrays, ...

Page 3 - Bull`s Eye Awards: Influencers of the Year - Spotlight news from Channel Insider
Everyone has a mentor or inspirer in their personal and professional lives. The recipients of the Influencers of the Year awards serve as the ...

Resources last updated: 2/8/2016 10:11:24 PM