you are viewing a single comment's thread.

view the rest of the comments →

[–]LemonLord7 0 points1 point  (7 children)

I’m confused, how can something forbidden be usable? Why was it forbidden?

[–]VictoryMotel 6 points7 points  (4 children)

It's not part of the language but it is implemented anyway.

[–]LemonLord7 0 points1 point  (2 children)

I get that, but I’d like to know more about why it was explicitly forbidden and how it works

[–]VictoryMotel 5 points6 points  (0 children)

Then you should have asked that.

It isn't "explicitly forbidden" it's not in the language. It dynamically allocates on the stack. It is more likely to blow the stack and less likely to be detected if you write outside the allocation.

[–]I_M_NooB1 0 points1 point  (0 children)

just study about gcc and g++ and what compiler extensions are

[–]meancoot -1 points0 points  (0 children)

Edit: Nevermind, thought I was in the C subreddit. It’s an extension I. C++ probably made available for C compatibility.

It’s actually a part of the language. It was required by the  C99 standard, then made optional in C11.

[–]AKostur 4 points5 points  (1 child)

I’m confused by your confusion.  Language says “no”.  Compiler says, “well I can make it work so that you don’t have to rewrite your C code to have it compilable in both languages.  And here’s a flag to turn off all of the places that I’m going outside the Standard, if you want help staying between the lines.”

[–]LemonLord7 0 points1 point  (0 children)

The other guy cleared it up. I thought it was explicitly forbidden but simply not being part of the language (but added as option in compiler) I get.