Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

ISO Updates C Standard

timothy posted more than 2 years ago | from the now-known-as-d-no-wait dept.

Programming 378

An anonymous reader writes "The International Organization for Standardization (ISO) has published the new specifications for the C programming language. The standard is known unofficially as C1X and was published officially as ISO/IEC 9899:2011. It provides greater compatibility with the C++ language and adds new features to C (as indicated in the draft)."

cancel ×

378 comments

Sorry! There are no comments related to the filter you selected.

First post!! (5, Insightful)

Anonymous Coward | more than 2 years ago | (#38480358)

Actually, who cares about that?

Seriously, though, am I the only one who finds it strange that one has to buy copies of the standard?

Re:First post!! (1)

kthreadd (1558445) | more than 2 years ago | (#38480366)

Not really, a lot of books cost money. Why would this one be different?

Re:First post!! (5, Informative)

Anonymous Coward | more than 2 years ago | (#38480440)

Oh? $300? For a PDF file? Heh.

Re:First post!! (0)

Anonymous Coward | more than 2 years ago | (#38480462)

Is it on piratebay

Re:First post!! (0)

Anonymous Coward | more than 2 years ago | (#38480562)

Link or it didn't happen.

Re:First post!! (2)

guus_deleeuw (599534) | more than 2 years ago | (#38480570)

Exactly, it's not a reasonable $5 per copy (which I think will make them a lot more money than selling it for $300).

Re:First post!! (4, Funny)

93 Escort Wagon (326346) | more than 2 years ago | (#38480612)

Oh? $300? For a PDF file? Heh.

But these limited-edition PDFs are signed and numbered.

Re:First post!! (2)

thegarbz (1787294) | more than 2 years ago | (#38481164)

You laugh. But the PDFs we get at work through a subscription to a site that provides various standards are "limited to view for 48 hours". Unfortunately the limited to view bit is simply a javascript code that checks to see if the file was downloaded more than 4 days ago (date imprinted on each PDF when you download) and then covers the screen with a big denied message blocking the text.

DRM at its finest. Pity I have Javascript disabled in Acrobat. Also you can simply print the PDF to CutePDF to strip out the Javascript, or strip it out with any PDF editor that allows scripting.

ISO/ANSI USED TO SELL BY PAGE !! (-1)

Anonymous Coward | more than 2 years ago | (#38480644)

Way back when it was a set amouht BY PAGE, and you can bet ISO and ANSI would fluff even the most trivial document with void-of-use pages.

Take a look at the 14496 series. Anything that is remotely useful COST$ !!

PDFs are branded at the bottom of each page with the buyer's info.

Merry New Year Everibuddy !! and Happy CHHHHankockers too !!

Re:First post!! (4, Insightful)

dutchd00d (823703) | more than 2 years ago | (#38480526)

Not really, a lot of books cost money. Why would this one be different?

First of all, it's not a book. It's a PDF. Second of all, the Netherlands is a member body of ISO, so I have already paid for it through my taxes. I should be able to use the fruits of ISO without additional cost (or maybe some nominal fee). Third of all, an ISO standard has the status of a law: you'd better do it this way, or else. So they're telling me the law has changed, and then charging me 300 euros to find out precisely what the new law is. I believe that's called extortion.

Re:First post!! (5, Funny)

Noughmad (1044096) | more than 2 years ago | (#38480538)

The new standard have been on display for free at the Alpha Centauri planning office for the last fifty years.

Pesky space/time relavitity (0)

Anonymous Coward | more than 2 years ago | (#38481246)

Unfortunately when you spend years at light speed en route to and from Alpha Centauri by the time you return due to relativity hundreds or thousands of years have passed on earth. The C standard will be completely obsolete by them. However, the COBOL standard will still be perfectly valid.

Re:Pesky space/time relavitity (1)

barlevg (2111272) | more than 2 years ago | (#38481348)

Actually, Alpha Centaru is only ~4.4 ly away. If you travel there and back at near-lightspeed, your friends on Earth will only have noticed you were gone for ~8.8 years, and thanks to time dilation, practically NO time will have passed for you.

Re:First post!! (1)

mirix (1649853) | more than 2 years ago | (#38480590)

This, so very much. I've always found it mindboggling to pay for standards like this.

Pay for the work creating the standard, sure. But copies? (digital no less) wtf? Don't they want people to adopt the standard?

I can see if it's some small industry-specific council perhaps, but the ISO?!

Re:First post!! (0)

Anonymous Coward | more than 2 years ago | (#38480982)

So they're telling me the law has changed, and then charging me 300 euros to find out precisely what the new law is. I believe that's called extortion.

no , extortion is not a new law, that's been there some time.

Re:First post!! (5, Informative)

TheRaven64 (641858) | more than 2 years ago | (#38480998)

The last draft and the errata are always free downloads. That's what I've been using to implement the atomics stuff in clang / FreeBSD.

Re:First post!! (1)

Hentes (2461350) | more than 2 years ago | (#38480970)

Because it's not a book but a language standard. If you want your standards to be recognized, keep them open and free of charge.

Re:First post!! (4, Informative)

wzzzzrd (886091) | more than 2 years ago | (#38481028)

It's 300 bucks, it was produced by a committee financed by tax payer's money, it's a pdf, not even a printed book. It's an open standard and will be needed by a lot of developers who want or must write standard compliant code. This is EXACTLY the thing RMS means when he is shouting his song.

Grab the original file from here [thepiratebay.org] .

Re:First post!! (0)

Anonymous Coward | more than 2 years ago | (#38481070)

Isn't the topic here a new C standard, not C++?

Re:First post!! (5, Insightful)

symbolset (646467) | more than 2 years ago | (#38480384)

Actually though, most of us. Changes to the C standard are a big deal.

Re:First post!! (3, Funny)

Anonymous Coward | more than 2 years ago | (#38480406)

Do they sell them by the C-shore?

Re:First post!! (5, Funny)

JustOK (667959) | more than 2 years ago | (#38480474)

yes, if you have 300 clams.

At least... (-1)

Anonymous Coward | more than 2 years ago | (#38480370)

...they waited after Dennis Ritchie had died.

Re:At least... (0)

xushi (740195) | more than 2 years ago | (#38480396)

... or... was it planned that way? o_O

Re:At least... (-1)

Anonymous Coward | more than 2 years ago | (#38481376)

FFS why the fuck was I modded down? Not everything has to be straight to the boring point.. So many people here talk shit anyway. And heck, apparently /. allows racism too, with people saying "niggers" et all in other threads...

stop fscking modding me down and grow up! I might as well start posting as Anonymous from now on.. fscking hell.

Re:At least... (1)

symbolset (646467) | more than 2 years ago | (#38480404)

You went AC on this one because you knew it was a horrid thing to say. Are you proud of yourself now? That would measure you.

Re:At least... (2)

the_B0fh (208483) | more than 2 years ago | (#38480422)

Why would Dennis Ritchie have anything against it?

Re:At least... (0)

Anonymous Coward | more than 2 years ago | (#38480436)

Microsoft-designed "secure function" cancer?

Re:At least... (2)

93 Escort Wagon (326346) | more than 2 years ago | (#38480608)

Microsoft-designed "secure function" cancer?

I'm beginning to think we need a new "law" styled somewhat after Godwin's Law - let's call it "93 Escort Wagon's Law". It goes as follows:

"As any online discussion grows longer, the probability of someone mentioning Microsoft in a derogatory manner approaches 1."

It might also make sense to add a "Slashdot Corollary" under which Microsoft and Apple are interchangeable.

Re:At least... (1)

NickFortune (613926) | more than 2 years ago | (#38480850)

"As any online discussion grows longer, the probability of someone mentioning Microsoft in a derogatory manner approaches 1."

I think we can generalise it a bit better than that.

"As any online discussion grows longer, the probability of someone mentioning anyone or anything in a derogatory manner approaches 1."

It might also make sense to add a "Slashdot Corollary" under which Microsoft and Apple are interchangeable.

And just those two and no others, because no-one ever says mean things about (let's say) Google or the FSF on this forum. Or maybe a better corollary might be "The better known the person or organization, the faster the probability approaches unity".

Re:At least... (1)

sydneyfong (410107) | more than 2 years ago | (#38480936)

"As any online discussion grows longer, the probability of someone mentioning Microsoft in a derogatory manner approaches 1."

I think we can generalise it a bit better than that.

"As any online discussion grows longer, the probability of someone mentioning anyone or anything in a derogatory manner approaches 1."

It's actually a variant of the typing monkey thing: As any online discussion grows longer (by monkeys typing on their keyboards), the probability of some monkey mentioning *anything* approaches 1.

Re:At least... (1)

epine (68316) | more than 2 years ago | (#38481284)

It's actually a variant of the typing monkey thing

No, no, no. This riff only applies to a memoryless process. Long discussion threads are more like star formation. Once you get above a critical mass of Gates, Jobs, Portman, Hitler, Netcraft, emacs, vi, fiat currency, Russian dyslexia, and dcxk intelligent thought can only form at the event horizon, and the fragment emitted is barely visible against the entropic background.

Re:At least... (1)

TheRaven64 (641858) | more than 2 years ago | (#38481010)

In this case it's entirely justified, although those functions have been an optional part of C as TR 24731-1 for a few years. They are entirely pointless (with the possible exception of gets_s) - they only address bugs that result from spectacularly bad code, and the sort of person who writes code that bad won't use the _s variants.

Re:At least... (1, Troll)

guus_deleeuw (599534) | more than 2 years ago | (#38480536)

I don't know, but apparently they had to kill him before they could release this ;-)

Let's get C99 right first (2, Informative)

JDG1980 (2438906) | more than 2 years ago | (#38480428)

Currently, Microsoft Visual Studio does not even support the C99 standard. Unfortunately, it's unlikely that this standard will be widely adopted any time soon when Microsoft seems to be content to let standard C wither and die.

Re:Let's get C99 right first (4, Informative)

wdef (1050680) | more than 2 years ago | (#38480446)

C is withering and dying? Isn't it still used more than any other language: http://langpop.com/ [langpop.com]

Re:Let's get C99 right first (4, Insightful)

Feltope (927486) | more than 2 years ago | (#38480516)

COBOL is king, always will be.

Solid and reliable code that works period!

Re:Let's get C99 right first (2)

tapspace (2368622) | more than 2 years ago | (#38480674)

What OS kernel is written in Cobol again? I seem to have forgotten. Real mission critical stuff at Boeing? NASA? All that stuff then right?

Re:Let's get C99 right first (4, Interesting)

rev0lt (1950662) | more than 2 years ago | (#38480852)

The solidity and reliability of COBOL code comes from decades of correcting bugs and lack of features of most applications that are still in use today. And yes, I've worked professionally as a COBOL programmer.

Re:Let's get C99 right first (4, Insightful)

JDG1980 (2438906) | more than 2 years ago | (#38480654)

Microsoft wants C to die. No one else is cooperating with them on this. As a result, Windows developers are stuck with worse tools for C than developers on almost any other platform. (Yes, there's MinGW, but it's a real pain and does not support many newer Windows APIs at all.)

Re:Let's get C99 right first (-1)

Anonymous Coward | more than 2 years ago | (#38480774)

Hi, I'm a Windows developer.

I'll take C# over C any day, and I have 20 years of C experience.

Re:Let's get C99 right first (4, Interesting)

Freestyling (997523) | more than 2 years ago | (#38480790)

Hi, I'm a Windows developer.

I'll take C# over C any day, and I have 20 years of C experience.

I believe that's kinda the parent poster's point. For a windows developer MS make their proprietary C# language easy, and C hard work. Now for most stuff that's fine, but sometimes a lower level language is needed. Ever tried writing a kernel mode driver in C#?

Re:Let's get C99 right first (3, Informative)

Anonymous Coward | more than 2 years ago | (#38480826)

For a windows developer MS make their proprietary C# language easy, and C hard work. Now for most stuff that's fine, but sometimes a lower level language is needed.

Interesting, it's like you've never heard of C++ which MS does fully support [slowly] and is standard. I know pure C is a sacred cow but writing pure procedural code in C++ won't kill you, in fact, it will probably make the code much easier to read since you can't just arbitrarily cast back and forth between void pointers and other types without explicit type brackets.

Ever tried writing a kernel mode driver in C#?

MS has been experimenting with that but it seems more likely that they'll just hoist most drivers into user space services so you can use any language, .Net based or not. They've already hoisted some USB drivers and the bulk of WDDM video card drivers, just backwards compatibility in the way for the rest.

Re:Let's get C99 right first (4, Informative)

rev0lt (1950662) | more than 2 years ago | (#38480910)

Actually, C# is as proprietary as C - it isn't. Check http://msdn.microsoft.com/en-us/netframework/aa569283 [microsoft.com] for the ISO standard details regarding C#.
Microsoft .NET implementation is proprietary, but there is an early open source release of the .NET CLI implementation codenamed "Rotor", for XP, FreeBSD and MacOS X. Additionally, the Mono project is an opensource clean-room implementation, but it may not be feature-complete.

Microsoft Research has an interesting project called Singularity - an operating system running (mostly) in managed code. Some initialization routines are done in Assembly/C/C++, but the kernel itself and respective drivers are written entirely in managed code. Check http://en.wikipedia.org/wiki/Singularity_(operating_system) [wikipedia.org] .

Re:Let's get C99 right first (1)

beelsebob (529313) | more than 2 years ago | (#38480912)

Yes and no – it's more that for programming applications, a higher level language is a good idea –not dealing with memory management and every low level detail is exactly what you want there. This is why Apple keeps taking Objective-C more and more away from C too (though it's still way closer - still a strict superset - than most HLLs).

Don't get me wrong – C is a fine language for coding OSes, non-safety-critical embedded systems, etc in. But there's absolutely no denying that C# is better for application level code.

Re:Let's get C99 right first (1)

Anonymous Coward | more than 2 years ago | (#38480818)

I'll take C# over C any day

Well you can have it. Door is that way. Goodbye.

Re:Let's get C99 right first (1)

DarwinSurvivor (1752106) | more than 2 years ago | (#38480924)

Bad tools I can deal with, sloppy API's I can deal with, heck even the messed up compiler I can deal with. What REALLY pisses me off with c development in Windows is that MSDN offers absolutely NO way to search for api's for a specific language. Sure if you use c++, objective-c or c# you simply add "c++", etc to your search query and it works fine, but typing in "spawn process in c" causes the "c" to match "c", "c++", "objective-c" and "c#". This makes it damn near impossible to find the bindings for straight c for ANY function call.

/endrant

Re:Let's get C99 right first (5, Interesting)

Daniel Phillips (238627) | more than 2 years ago | (#38480448)

Who cares about Microsoft these days? Any damage they cause by lagging behind standards is only to themselves, unlike the bad old days. In the modern world GCC is the bar by which Microsoft is measured, and usually found lacking.

Re:Let's get C99 right first (3, Informative)

JDG1980 (2438906) | more than 2 years ago | (#38480658)

Unfortunately, the damage goes beyond that. You can't effectively use GCC (MinGW) to build most Windows applications, not only because these applications are full of Visual C++isms, but also because many newer APIs (notably Direct2D and DirectWrite) are not currently supported under MinGW at all.

Re:Let's get C99 right first (3, Informative)

TheRaven64 (641858) | more than 2 years ago | (#38481018)

GCC? People still use that? Clang can now parse a lot of the standard windows headers. 3.1 should have finished implementing the required quirks to understand the Windows templates. There's also work underway to support the Win64 exception model, which will hopefully be done by the 3.1 release.

Re:Let's get C99 right first (4, Interesting)

Richard_at_work (517087) | more than 2 years ago | (#38480870)

Not being a C or C++ developer, I'm not sure who to believe - in the Firefox compilation story a few days ago, there were a fair few highly modded up posts extoling the virtues of the quality and speed of binaries output by the MS C and C++ compiler over GCC.

Any thoughts on that?

Re:Let's get C99 right first (1)

equex (747231) | more than 2 years ago | (#38481238)

MS developer tools has been very good since the VC6 era.

Re:Let's get C99 right first (4, Informative)

shutdown -p now (807394) | more than 2 years ago | (#38481332)

Simply put, gcc beats VC on standard compliance, and VC beats gcc on optimization quality.

Anyway, VC is primarily a C++ compiler. C support is largely legacy, and hasn't been updated for a long time now.

Re:Let's get C99 right first (0)

beelsebob (529313) | more than 2 years ago | (#38480920)

Actually, clang is more like the bar these days.

Re:Let's get C99 right first (1)

rev0lt (1950662) | more than 2 years ago | (#38480932)

So, you have no other choice of C compilers for Windows?

move on (4, Insightful)

OrangeTide (124937) | more than 2 years ago | (#38480458)

Many of us gave up waiting on Microsoft for our development tools.

Re:Let's get C99 right first (2)

nzac (1822298) | more than 2 years ago | (#38480472)

How is C in anyway dependent on Microsoft VS support? VS as far as I can tell is for writing User level applications on managed code where C is terrible. Even GTK have realized that objects are good for writing most Applications.

The reason c is still around is to write the low level stuff that you can't swap out in windows. If MS could set the programming languages, C would not have been taught for at least 10 years and everything would be full of the lag and bloat that comes with non native code.

Re:Let's get C99 right first (1, Redundant)

Dwedit (232252) | more than 2 years ago | (#38480540)

The big problem is that you can't compile C programs that make use of GCC extensions using Visual C++. This includes even the most basic stuff, like declaring variables in the middle of your code. It's actually a GCC extension to C, despite being a standard feature of C++.

The only way to compile such programs on Visual Studio is to force the compiler to use C++ mode instead of C mode. Then you get a bunch of compiler errors, because C++ is a different language than C, and gives errors when you assign pointer types that don't match. You need to find every single malloc, then cast it to the correct pointer type the compiler wants you to use, otherwise it refuses to build. Then find all the other pointer assignments that fail as well. Always tons of those.

Re:Let's get C99 right first (-1, Redundant)

mrchaotica (681592) | more than 2 years ago | (#38480584)

...like declaring variables in the middle of your code...

That's a good thing! Declaring variables at the beginning of their scope makes the code more readable and easier to debug. And if you really need an extra variable down in the middle of your function, you can always put some curly braces around the few lines that use it (and then it goes out of scope when you're done with it!).

Re:Let's get C99 right first (0)

Anonymous Coward | more than 2 years ago | (#38481336)

I just wish they'd support declaring/defining loop scope index variables.


for (int fooListIdx = iterStart; fooListIdx < fooListSz; fooListIdx++) {

/* Do stuff using fooList[fooListIdx] */

}

But no, I have to either back up to the enclosing scope to define fooListIdx, or throw another scope in there that encloses only the loop. Or pretend it's C++. Very frustrating when maintaining a codebase that is compiled on three or more other platforms, as we have to damage good code to make it work with VS.

Re:Let's get C99 right first (0)

nzac (1822298) | more than 2 years ago | (#38480592)

Use another compiler, yes its not convenient but why would you use C in the first place you know MS will be a dick about it.

There are advantages and disadvantages to living the MS dev walled garden. I think if you use a non CLR language with just MS tools you are asking for a little pain.

Re:Let's get C99 right first (1)

Anonymous Coward | more than 2 years ago | (#38480660)

That's actually (not to start a flame) a bug in C++ that has recently been fixed;
however in either language you shouldn't be assigning different pointer types to each
other unless one is a void pointer...

Re:Let's get C99 right first (4, Informative)

Anonymous Coward | more than 2 years ago | (#38480680)

"This includes even the most basic stuff, like declaring variables in the middle of your code. It's actually a GCC extension to C"

No it's not— it's part of ISO C99.

Re:Let's get C99 right first (3, Insightful)

kthreadd (1558445) | more than 2 years ago | (#38480720)

If your program relies on the presence of GCC extensions, you did it wrong in the first place.

Re:Let's get C99 right first (0)

Shinobi (19308) | more than 2 years ago | (#38480776)

"The big problem is that you can't compile C programs that make use of GCC extensions using Visual C++. "

And being reliant on GCC non-standard stuff is just as stupid as relying on Microsoft non-standard stuff, if you truly believe in standards-compliance, portability and diversity. Truly portable code is code that can be compiled with any compiler for that specific language.

That is one of the reasons why I find so many FSF supporters to be such hypocrits, they blather on about standards compliance, yet they use and abuse GCC extensions etc. The Linux kernel is horribly tainted in that way.

Re:Let's get C99 right first (0)

Anonymous Coward | more than 2 years ago | (#38480808)

You can't write an OS kernel in standard C anyway. It's in some ways inherently lower level stuff.

Re:Let's get C99 right first (1)

wzzzzrd (886091) | more than 2 years ago | (#38480996)

You can't write an OS kernel in standard C anyway. It's in some ways inherently lower level stuff.

What would be the obstacle to writing an OS kernel in C99? What would one need the extensions for?

Re:Let's get C99 right first (1)

Clueless Moron (548336) | more than 2 years ago | (#38481378)

That is one of the reasons why I find so many FSF supporters to be such hypocrits, they blather on about standards compliance, yet they use and abuse GCC extensions etc. The Linux kernel is horribly tainted in that way.

Linux can be compiled using the Intel C compiler [linuxjournal.com]

See include/linux/compiler*.h in your kernel source

Re:Let's get C99 right first (0)

Anonymous Coward | more than 2 years ago | (#38480846)

Yet, Microsoft heavily influenced this C standard, again by screwing the people in favour of their own interests. If you inform yourself on how the threads part of this C standard got itself into the standard, you will learn that it was due to Microsoft refusing to accept that the standard referenced other standards which were incentives to interoperability. More precisely, it was due to Microsoft refusing that the C standard implemented pthreads by referencing the POSIX standard. So, in order to avoid having an interoperability standard being cemented in the computing world, they abused their dominance and imposed a half-baked API claiming that it would make it possible to wrap other APIs in the standard way, ignoring that pthreads are already an international standard API.

Re:Let's get C99 right first (0)

Anonymous Coward | more than 2 years ago | (#38480482)

You can buy intels compiler and plug it in to Visual Studio, then you have full C99, including designated initializer lists, which was my main feature that I wanted.

Re:Let's get C99 right first (3, Insightful)

hairyfeet (841228) | more than 2 years ago | (#38480628)

Don't forget to use the magic uncripple settings [theinquirer.net] if you do that Mr AC or you'll be tying a boat anchor to every non Intel chip that tries to run you code.

Re:Let's get C99 right first (1)

Anonymous Coward | more than 2 years ago | (#38480486)

GCC provides support for C99 ... you can run it on Windows if you wish ... not to mention there are various non-Microsoft commercial compilers (like the Intel compiler) that can be used ...

Re:Let's get C99 right first (1)

mwvdlee (775178) | more than 2 years ago | (#38480556)

Microsoft Visual Studio doesn't support a lot of things in whatever language.
It's hardly the standard by which to judge programming languages.
Although the fact that it is included in some form basically means the language is imporant enough that Microsoft couldn't replace it with one of their own languages.

Re:Let's get C99 right first (2)

peppepz (1311345) | more than 2 years ago | (#38480620)

Microsoft has been steering their developers away from C and C++ for a long time now. Using Visual Studio for pure native projects is a pain. The pre-release Visual Studio contained in the Windows 8 technical preview won't even allow you to write non-Metro applications (or at least they made it so hard that I couldn't find how to do it).

Fortunately, there are alternatives to Visual Studio even on Windows.

Re:Let's get C99 right first (1)

shutdown -p now (807394) | more than 2 years ago | (#38481366)

The position on native (read: C++) vs managed has been effectively reversed in Win8. All new APIs are implemented as native, and have direct C++ bindings. Win8 dev preview that you mentioned has VS11 Express pre-beta pre installed that only supports targeting Metro for all languages, not just for C++. That's because the purpose of dev preview is to showcase Metro app development. Full version of VS supports everything supported in past releases, and a prerelease can be separately downloaded and installed on Win8 DP.

Also, what kind of pain is there with using existing VS versions (esp. VS10) for pure native code? It has the single best code completion engine and debugger visualizers.

Re:Let's get C99 right first (0)

Anonymous Coward | more than 2 years ago | (#38480632)

Microsoft pressured the standards body to remove the requirement for vararrays, with those gone they're much closer to supporting the standard.

Re:Let's get C99 right first (0)

Anonymous Coward | more than 2 years ago | (#38480806)

Currently, Microsoft Visual Studio does not even support the C99 standard. Unfortunately, it's unlikely that this standard will be widely adopted any time soon when Microsoft seems to be content to let standard C wither and die.

You should not use Microsoft Visual Studio for writing programs since it is non-free.

OMG ! (0)

Anonymous Coward | more than 2 years ago | (#38480464)

blasphemy +

So... (2)

bytesex (112972) | more than 2 years ago | (#38480504)

I'm not willing to pony up 300 swiss Francs, so can anybody tell me, basically, how it is different ? Is it just the stuff that has creeped through in the last few years by means of gcc, or is it totally new ?

Re:So... (0)

Anonymous Coward | more than 2 years ago | (#38480510)

Grab the April 2011 Draft.

Re:So... (0)

Anonymous Coward | more than 2 years ago | (#38480546)

If it were just stuff from GCC, that would be good. That's what standards are supposed to be, a formal specification of what is already happening. This was actually a problem with C99. Complex numbers and VLAs, "LOL IM A LANGUAGE DESIGNAR!". Complex numbers were just wrong for C, and I don't think anyone had even asked for it. Variable length arrays were okay, but they should really just have standardised alloca.

Re:So... (1)

shentino (1139071) | more than 2 years ago | (#38480858)

I'd like to see them standardize the interaction between alloca and VLAs.

And are VLAs more than just a type-safe version of alloca?

Re:So... (4, Informative)

Old Wolf (56093) | more than 2 years ago | (#38480638)

C11 (0)

Anonymous Coward | more than 2 years ago | (#38480724)

inb4 Spinal Tap joke

Re:So... (4, Informative)

TheRaven64 (641858) | more than 2 years ago | (#38481068)

As with every other version of the C standard, you can read the draft yourself [open-std.org] . A few things that are nice:
  • A detailed and well-thought-out set of atomic operations. I've got a diff for clang that implements these that should be committed in the next few days after a bit of tidying. Ed Schouten has written the supporting header to FreeBSD libc, so these can be used now (with fall back to GCC intrinsics for a marginally slower implementation).
  • Unicode string literals and a few functions for manipulating them.
  • _Generic() letting you write type-generic macros.
  • Anonymous structure and union members, so you can write things like struct { int tag; union { void *ptr; uintptr_t i}; } s; and then refer to s.ptr or s.i, rather than needing to provide a name for the union (this is already a GNU extension, but it's nice to have it in the standard).
  • Static assertions, so you can do things like _Static_assert(sizeof(int) == 4, "This code path should not be used in ILP64 platforms!"); and get a compile-time error if it is.
  • A _Thread_local storage qualifier for thread-local variables (equivalent to the __thread GNU extension).
  • Alignment checks and specifiers.
  • A few things from POSIX, like the x specifier in fopen() for exclusive open.

Some of the not-so-nice features include threads.h, which is equivalent to pthreads but with a different function names (and ones that seem quite likely to cause conflicts with existing code).

C90 * (2)

tapspace (2368622) | more than 2 years ago | (#38480614)

I put C90 (ANSI C) on my resume, because it is more marketable. A serious employer wants to know that I know how to write C90, not just vaguely understand the C language. The fact is if your write ANSI C, it will work with just about any compiler (with the exception of any platform specific code). Many embedded compilers only support a subset of C99 anyway (usually, most, but that's the point, it's not all). ISO fussing with a new C revision is laughable.

Re:C90 * (2)

peppepz (1311345) | more than 2 years ago | (#38480668)

The problem is that with C90 you have to write more platform specific code. How do you handle 64-bit integers in C90, for example?

Re:C90 * (0)

Anonymous Coward | more than 2 years ago | (#38480736)

There is nothing in C90 that forbids 64-bit integers. You are thinking about implementations.

Re:C90 * (1)

TheRaven64 (641858) | more than 2 years ago | (#38481084)

C90 does not contain a standard type that has a 64-bit range. C99 defines long long, which must have a range greater than or equal to a 64-bit binary number. It also defines int64_t and uint64_t, which must have exactly the range of a 64-bit binary number. More usefully, it also defines [u]intptr_t, which must have the same size as void*. There is no C90 integer type that is guaranteed to be the same size as a pointer, and the fact that a lot of people assume that sizeof(long) == sizeof(void*) is one of the things most likely to be responsible for code not being portable.

I wouldn't hire anyone who wrote C90 these days. There's simply no excuse for it.

Re:C90 * (0)

Anonymous Coward | more than 2 years ago | (#38481090)

OK, so show us a snippet of C90 code that uses 64-bit integers.

Re:C90 * (1)

petermgreen (876956) | more than 2 years ago | (#38481120)

There is nothing in C90 that forbids 64-bit integers.

It doesn't forbid them but it doesn't standardise them either. Whether they are provided or not and the mechanism used to provide them is up to the individual implementation and as such any code that relies on them becomes implementation dependent.

Can't we please let C die? (-1)

Anonymous Coward | more than 2 years ago | (#38480618)

It has no added value above C++ and I've found out the hard way (through bugs in inherited C code) that its type system leaves a lot to be desired.

Re:Can't we please let C die? (4, Insightful)

jcr (53032) | more than 2 years ago | (#38481338)

You have that exactly backwards. It's C+++ that should die.

-jcr

Looks like story is already dated... (4, Informative)

ibsteve2u (1184603) | more than 2 years ago | (#38480686)

The standard is known unofficially as C1X

GCC already says: [gnu.org]

A fourth version of the C standard, known as C11, was published in 2011 as ISO/IEC 9899:2011. GCC has limited incomplete support for parts of this standard, enabled with -std=c11 or -std=iso9899:2011. (While in development, drafts of this standard version were referred to as C1X.)

Syntax is everything in C.

Re:Looks like story is already dated... (0)

Anonymous Coward | more than 2 years ago | (#38481038)

1) The GCC documentation isn't the authority on what people call the language.
2) If lots of people know it as C1X, then it is by definition known as C1X, regardless of what the actual authority calls it.

Poul-Henning's take on this. (5, Informative)

Anonymous Coward | more than 2 years ago | (#38480728)

https://www.varnish-cache.org/docs/trunk/phk/thetoolsweworkwith.html

Re:Poul-Henning's take on this. (1)

Anonymous Coward | more than 2 years ago | (#38481346)

The idiocy with C11 threads goes even a bit further. The C11 standards committee was hijacked to include a threading API which is notoriously poor, mainly due to how it was designed: to act as a wrapper to the windows API. To justify it,the committee also claimed that by wrapping the windows API it would also enabled them to provide an API which could be used to wrap other threading APIs, such as the pthreads API. Yet, what they were unable to explain was who exactly had the need to wrap the pthreads API, which is already an international standard definign a C API to handle threads. So, in essence the C11 committee decided to write a wrapper API to wrap a wrapper API. These are three abstraction layers we are talking about. And they did this supposedly because OS developers such as Microsoft would be unable to support pthreads, although they already do.

This is a braindead standard due to a corrupt standard committee. It's MS OOXML all over again.

Torrent? (0)

Anonymous Coward | more than 2 years ago | (#38480828)

Anyone know a torrent for this? $300 is insane. I just want to peruse it.

"Greater compatibility with C++ " (0)

jcr (53032) | more than 2 years ago | (#38481322)

Is that supposed to be a feature?

-jcr

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>