J
JOYCE
Look the subject,that's my problem!
I hope someone can help me, thanks
I hope someone can help me, thanks
JOYCE said:Look the subject,that's my problem!
I hope someone can help me, thanks
Look the subject,that's my problem!
I hope someone can help me, thanks
Look the subject,that's my problem!
I hope someone can help me, thanks
JOYCE wrote, On 04/11/08 11:58:
register is a hint to the compiler (which normally is not
needed and has not been needed for many years) which affects what you
can do with a variable, auto has not been needed as part of the language
for even longer since where it is legal the variable would have
automatic storage duration without using it.
Nick said:JOYCE wrote, On 04/11/08 11:58:
[what is the difference between register and auto]
register is a hint to the compiler (which normally is not
needed and has not been needed for many years) which affects what you
can do with a variable, auto has not been needed as part of the language
for even longer since where it is legal the variable would have
automatic storage duration without using it.
auto was still present in the 89 standard
JOYCE said:Look the subject,that's my problem!
I hope someone can help me, thanks
Nick Keighley said:JOYCE wrote, On 04/11/08 11:58:
[what is the difference between register and auto]
register is a hint to the compiler (which normally is not
needed and has not been needed for many years) which affects what you
can do with a variable, auto has not been needed as part of the language
for even longer since where it is legal the variable would have
automatic storage duration without using it.
auto was still present in the 89 standard
Keith Thompson said:Nick Keighley said:JOYCE wrote, On 04/11/08 11:58:
[what is the difference between register and auto]
register is a hint to the compiler (which normally is not
needed and has not been needed for many years) which affects what you
can do with a variable, auto has not been needed as part of the language
for even longer since where it is legal the variable would have
automatic storage duration without using it.
auto was still present in the 89 standard
auto is still in C99 as well; it's in the language, but either illegal
or redundant in all contexts. There's a proposal to drop it.
Nate Eldredge said:Was there ever a time when `auto' did something useful?
Nate Eldredge said:Keith Thompson said:Nick Keighley said:JOYCE wrote, On 04/11/08 11:58:
[what is the difference between register and auto]
register is a hint to the compiler (which normally is not
needed and has not been needed for many years) which affects what you
can do with a variable, auto has not been needed as part of the language
for even longer since where it is legal the variable would have
automatic storage duration without using it.
auto was still present in the 89 standard
auto is still in C99 as well; it's in the language, but either illegal
or redundant in all contexts. There's a proposal to drop it.
Was there ever a time when `auto' did something useful?
It seems to have been redundant even in K&R I.
Keith Thompson said:Yes. Pre-ANSI C allowed implicit int for object declarations, so
"auto i;" was equivalent to "auto int i;", but "i;" was illegal (if it
appeared before a declaration in the same block) or a reference to a
variable ``i''.
In K&R C, one might write:
foo(x, y)
{
auto i;
extern j;
/* ... */
}
Yes. Pre-ANSI C allowed implicit int for object declarations, so
"auto i;" was equivalent to "auto int i;", but "i;" was illegal (if it
appeared before a declaration in the same block) or a reference to a
variable ``i''.
In K&R C, one might write:
foo(x, y)
{
auto i;
extern j;
/* ... */
}
I *think* that "auto i;" is illegal in C90.
auto is used with variables to indicate they are not static
or external. That they are local to a function and are
(conceptually) created on entry and (conceptually) destroyed
on exit. A stack is often used to implement this.
int fred (void)
{
auto int i;
auto j
}
the above are both legal. j is implicitly int (at least in the 1989
standard for C).
Flash said:I still don't think auto was useful in K&R C since one could always have
used "int i;" instead of "auto i;" with the same effect. Perhaps pre-K&R
there was a situation where nothing other than auto would do?
Modern hosted compilers can use profile feedback to tune optimisations.Jack said:The programmer can often know things from the design of the code that
a compiler cannot discern without emulation or profiling of the entire
program.
Ian Collins said:Modern hosted compilers can use profile feedback to tune optimisations.
I haven't come across an embedded compilers that do this, but I expect
there are those that do.
Nick said:On 4 Nov, 12:51, Flash Gordon <[email protected]> wrote:
auto was still present in the 89 standard
Is profile feedback available on those embedded targets?Phil said:Haven't you come across GCC as an embedded compiler? I know at Freescale
all ARM- and POWER- targetted C was compiled using GCC. (OK, the DSPs and
PICs had other compilers, obviously.)
Ian Collins said:Is profile feedback available on those embedded targets?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.