Timeline for C99: Alternative to "static" variable declaration?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 28, 2021 at 16:05 | history | edited | trent | CC BY-SA 4.0 |
phrasing
|
May 28, 2021 at 16:03 | comment | added | mic | @trentcl Sorry... misunderstanding! I should really get some sleep :-D Of course you mean that "the decision ... is considered to have been a mistake", not the practice itself. | |
May 28, 2021 at 15:57 | comment | added | trent |
@mic I'm not sure where you think I said there's another way of getting file scope internal linkage without using the static keyword (or perhaps I misunderstand your question). Elaborate?
|
|
May 28, 2021 at 15:55 | comment | added | mic | @RobertHarvey Yes, this was my understanding up to now, but trentcl seems to disagree. But regarding storage duration: Of course outside a function I don't have to declare a variable static to have static storage duration. However, I don't do this for that purpose, but to have internal linkage. So I still don't understand Derek's concern. | |
May 28, 2021 at 15:37 | comment | added | Robert Harvey |
@mic: static is the defined way to get file scope internal linkage.
|
|
May 28, 2021 at 15:34 | comment | added | mic | Hmmm... so the only "other way of denoting that storage duration" is to make the variable global by just not using static? And how else would I have internal linkage of file-scope variables without using static? | |
May 28, 2021 at 15:11 | history | answered | trent | CC BY-SA 4.0 |