Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What will this C code do?

Name: Anonymous 2012-01-19 8:24

void main(){
int x=1;
printf("%d\n",x=2);
}

Name: Anonymous 2012-01-22 16:03

>>160
I said they cannot have no linkage

That really isn't clear. You might want to work on your grammar there buddy.

The only variables with no linkage are those declared at block scope

Again, that's incorrect. Those variables have to have some kind of linkage, otherwise, if I compile this C program against another C program, I could access those variables in that block.

Name: Anonymous 2012-01-22 16:08

>>161
The type of linkage just happens to be referred to as "no linkage".

What I quoted is from the standard, and you're saying it's wrong.

Name: Anonymous 2012-01-22 16:11

>>162
Now I see why you don't work any kind of engineering job. You clearly can't comprehend what you read. Again, global variables do not have static storage duration. This fact is pretty clear from reading the standard. Why you keep asserting something that the standard clearly doesn't imply goes beyond me.

Name: Anonymous 2012-01-22 16:13

>>163
Can we agree that global variables have either internal linkage or external linkage?

Name: Anonymous 2012-01-22 16:14

>>164
Yes. However, the rest of it I don't agree with because you are just making unfounded assumptions when reading the standard.

Name: Anonymous 2012-01-22 16:16

>>165
Now read this part:
An object whose identifier is declared with external or internal linkage, or with the storage-class specifier static has static storage duration.

No assumptions made at all.

Name: Anonymous 2012-01-22 16:16

>>161
I renig on this response. I was mixing up scope with linkage.

Name: Anonymous 2012-01-22 16:18

>>166
I see an 'or' and not an 'and'. In other words, the latter can be false and the former would still be true.

Name: Anonymous 2012-01-22 16:22

hax anii everyday
anii MUST be haxxed

Name: Anonymous 2012-01-22 16:26

>>168
A variable at block scope with the storage-class specifier static doesn't have internal linkage. That's why it was emphasized, sorry, although it would have been better to say "an object whose identifier is declared with external or with the storage-class specifier static..."

Name: Anonymous 2012-01-22 16:27

"an object whose identifier is declared with external linkage or with the storage-class specifier static..." rather

Name: Anonymous 2012-01-22 16:30

>>170
The topic is about global variables. Not variables at block scope. Now again, try and stay focused you stupid sit.

Name: Anonymous 2012-01-22 16:33

>>172
I'm explaining why it mentions "or with the storage-class specifier static" you moran. I've already said everything I had to say. All that's left is for you to acquire at least a fifth grade reading level.

Name: Anonymous 2012-01-22 16:36

>>173
You're the faggot that is going off topic by talking about unrelated stuff such as variables at block scope. Also,

I've already said everything I had to say. All that's left is for you to acquire at least a fifth grade reading level.

You still haven't explained how having variables at block scope level supports 'global variables have static duration'.

Name: Anonymous 2012-01-22 16:39

>>174
I'm saying if a variable at block scope is declared with specifier static, it has static duration, but not internal linkage. That's why it was mentioned. The fact that variables with external or internal linkage have static duration already supports my claim. I swear if I have to repeat the same thing one more time...

Name: Anonymous 2012-01-22 16:41

>>175
That only applies to variables at block scope. There are other variables. Namely global ones.

Name: Anonymous 2012-01-22 16:42

>>175
And again, you're making the assumption that variables at block scope apply to global variables.

Name: Anonymous 2012-01-22 18:14

C is too complex, error-prone and bloated with undefined behaviour.

Code in assembly instead!

How should I divide my assembly files into modules? Should I use headers with macros and structure definitions (nasm supports both) or should I concatenate everything in one single file?  I'll go experiment and see if the linker (GNU ld) is smart enough to DWIM when I use extern and global. by the way I'm coding a toy OS in assembly, no dynamic module loading, monolithic.

Name: Anonymous 2012-01-22 18:41

Name: Anonymous 2012-01-22 21:40

A fatal error occured!

You didn't write a post?!

Powered by Shiichan 3955 + 4chan 20080608.

Name: Anonymous 2012-01-22 23:10

>>180
Yes I did, [spoiler]friend[/friend]

Name: Anonymous 2012-01-22 23:56

>>181
BBcode [spoiler]failure[/failure].

Name: Anonymous 2012-01-23 1:00

>>182
[spoiler]lol[/lol][/b][/u][/(defun dicks x y (format("uheruehruher"))]

Name: Anonymous 2012-01-23 4:08

>>176,177
you're such a fucking retard

Name: Anonymous 2012-01-23 11:49

>>178
Concatenate them together? Jeez.

Name: Anonymous 2012-01-23 15:32

>>185
Oh. Right. I feel a bit like an idiot now.

Name: Anonymous 2012-01-23 16:18

>>188
nice dubs bro

Name: Anonymous 2012-01-23 16:27

>>187
fuck off and die faggot

Name: Anonymous 2012-01-23 17:05

>>188
nice dubs

Name: Anonymous 2012-01-23 22:18

>>185
Are you sure this is a good idea? Won't macros and symbols collide?

Name: Sensei 2012-01-24 2:03

Praimu-no bango desu, yo!

191 GET

$ factor 191
191: 191

Name: Sensei 2012-01-24 2:05

$ factor 192
192: 2 2 2 2 2 2 3

2^3 * 2^3 + 2^3 * 2^3 + 2^3 * 2^3

GET

Name: Sensei 2012-01-24 2:07

Mo hitotsu!

$ factor 193
193: 193

GET!

Name: Geechan 2012-01-24 2:09

2 * 97 ha, anmari omoshiroku nain desu yo.

Nee, Sensei ...

Puraimu ja nai toka, dabsu mo nai ...

Aaaa ... nemui! Neru yo. Mata ashita ...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List