Slashdot Mirror


ISO Updates C Standard

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)."

378 comments

  1. First post!! by Anonymous Coward · · Score: 5, Insightful

    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?

    1. Re:First post!! by kthreadd · · Score: 1

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

    2. Re:First post!! by symbolset · · Score: 5, Insightful

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

      --
      Help stamp out iliturcy.
    3. Re:First post!! by Anonymous Coward · · Score: 3, Funny

      Do they sell them by the C-shore?

    4. Re:First post!! by Anonymous Coward · · Score: 5, Informative

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

    5. Re:First post!! by Anonymous Coward · · Score: 0

      Is it on piratebay

    6. Re:First post!! by JustOK · · Score: 5, Funny

      yes, if you have 300 clams.

      --
      rewriting history since 2109
    7. Re:First post!! by dutchd00d · · Score: 4, Insightful

      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.

    8. Re:First post!! by Noughmad · · Score: 5, Funny

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

      --
      PlusFive Slashdot reader for Android. Can post comments.
    9. Re:First post!! by Anonymous Coward · · Score: 0

      Link or it didn't happen.

    10. Re:First post!! by guus_deleeuw · · Score: 2

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

    11. Re:First post!! by mirix · · Score: 1

      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?!

      --
      Sent from my PDP-11
    12. Re:First post!! by 93+Escort+Wagon · · Score: 4, Funny

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

      But these limited-edition PDFs are signed and numbered.

      --
      #DeleteChrome
    13. Re:First post!! by Hentes · · Score: 1

      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.

    14. Re:First post!! by Anonymous Coward · · Score: 0

      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.

    15. Re:First post!! by TheRaven64 · · Score: 5, Informative

      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.

      --
      I am TheRaven on Soylent News
    16. Re:First post!! by wzzzzrd · · Score: 4, Informative

      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.

      --
      On second thought, let's not go to Camelot. It is a silly place.
    17. Re:First post!! by Anonymous Coward · · Score: 0

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

    18. Re:First post!! by thegarbz · · Score: 2

      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.

    19. Re:First post!! by NekSnappa · · Score: 3, Funny

      I think you meant c-shells.

      --
      I want to shoot the messenger!
    20. Re:First post!! by bunratty · · Score: 4, Insightful

      You're not paying for just the production or distribution of the file, book, movie, music, software, or drug when you pay for those things. You're paying for the effort required to make the item in the first place. If it takes someone one year to write a book, they need to recieve much more than the cost of distributing a PDF file to make a living from writing.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    21. Re:First post!! by bunratty · · Score: 1

      Developers don't need to know the standard. Compiler writers need to know the standard.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    22. Re:First post!! by Anonymous Coward · · Score: 0

      Wrong link. That is the new C++ standard.
      Which is even more expensive ($325) by the way....

    23. Re:First post!! by bunratty · · Score: 1

      The most recognized standards are those you need to pay for. When I implemented HDLC, I used the standards documents that my company bought. If companies did not adopt standards because they were too cheap to pay the $300 for the standards documents, you might have a point. Of course, that small amount of money gives a great ROI, so any company that was that cheap would not stay in business for long.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    24. Re:First post!! by Vanders · · Score: 3, Funny

      Developers can't write standards compliant code without knowing what the standards are.

      Oh what am I saying? Developers won't write standards compliant code even if they do know what the standards are!

    25. Re:First post!! by Hentes · · Score: 1

      The problem is that with a restrictive licence the owner can change the price whenever they want, or decide who will get a licence and who doesn't, thus giving them complete control and effective monopoly over a market segment.

    26. Re:First post!! by fnj · · Score: 1

      The fuck they don't. If, I mean WHEN, they want an authoritative answer to some question about the language, they need the standard. Anything else is just an opinion.

    27. Re:First post!! by Anonymous Coward · · Score: 0

      Sorry, that's C++11, not C11. Can you find C11 there?

    28. Re:First post!! by surmak · · Score: 2

      I cannot say for the C standard, but in my work, we do some standards development under ISO. None of this work is funded by ISO -- it is either funded by my employer, or government agencies, commercial end-users, or others that have in interest in the technology getting standardized. This process can be quite expensive -- salaries, travel, meetings, but none of that is paid by ISO. It is all paid by the participants (or funding they can acquire from other interested parties.).

      ISO basically acts as a middleman. They collect their fee on the work done by others, and do not provide any value add other than blessing the standard as an International Standard.

    29. Re:First post!! by Anonymous Coward · · Score: 0

      What's funny about this?

    30. Re:First post!! by Noughmad · · Score: 2

      I'm not realy sure, but here are my best three guesses:

      1. I am a funny guy (in general)
      2. There is a grammatical mistake I didn't catch before clicking Submit
      3. It references The Hitchhiker's Guide to the Galaxy

      --
      PlusFive Slashdot reader for Android. Can post comments.
    31. Re:First post!! by KiloByte · · Score: 1

      Your torrent is for C++, not C. Still a vital thing to grab, just not what we need for this article.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    32. Re:First post!! by bunratty · · Score: 1

      I've never looked at standard documents when I write code, and I'm sure the same is true for most other developers. You're just making up excuses to be argumentative. The only people that really need to look at the standards is the people who implement the standard -- these are the people the standards documents are written for.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    33. Re:First post!! by Anonymous Coward · · Score: 0

      This is why we need laws against linking to copyright material. Your rant makes no sense. Clearly the ISO is also funded by purchasers of the standards. You want to change that, petition it the right way to the appropriate people. More tax-payer money will be needed. The fact it's just a PDF makes no difference to the cost of mastering it, and if something is useful that makes it worth more money, not less. I agree with you that these standards would be free in an ideal world, but it's not an ideal world, and advocating piracy in response makes it a worse world, not a better one. Grow up.

    34. Re:First post!! by dargaud · · Score: 1

      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.

      RMS is so often right it's not even funny anymore.

      --
      Non-Linux Penguins ?
    35. Re:First post!! by bonch · · Score: 4, Informative

      This is EXACTLY the thing RMS means when he is shouting his song.

      Of course, when he's not doing that, he's advocating necrophilia and "voluntary pedophilia". Maybe not the best spokesperson to get behind.

    36. Re:First post!! by Anonymous Coward · · Score: 0

      Let's see, the in first link he suggests necrophilia with the consent of the deceased sounds fine to him. In the second link he says lowering the age of consent from 16 to 12 might be something to consider. The latter would be ephebophilia, not pedophilia as sex with prepubescent children is not under discussion. That said, the age of consent in most jurisdictions is higher because younger adolescents are not considered by society to be capable of understanding the consequences of consenting to sex, which seems like a pretty good argument to me... as long as the laws are worded such that two adolescents of about the same age having sex isn't automatically illegal.

    37. Re:First post!! by Anonymous Coward · · Score: 0

      they need to recieve much more than the cost of distributing a PDF file to make a living from writing.

      Well, not if the work is crappy. Customers pay to be entertained. It's only fair that you pay only for the amount of giggles you get (or whatever parameter prompted you to purchase the item). You should be able to get a refund for 'missing giggles' at the ticket counter after the movie.

      Being a writer or director doesn't mean your work is worth the effort. If you wanna make a living, get a real job !! instead of tricking people into buying your piece of shite works of art. It's this attitude of self-entitlement that makes people not feel sorry for piracy.

    38. Re:First post!! by Anonymous Coward · · Score: 0

      What the fuck are you talking about? Have you ever coded C? The standard is needed for both.

    39. Re:First post!! by Mr+Z · · Score: 1

      More like $360 USD.

    40. Re:First post!! by Myopic · · Score: 1

      If his desire is for the committee process to be funded with taxes, then linking to pirate copies of the costly PDF is, precisely, an attempt to achieve that policy. I agree with him on that point: I want big government and high taxes to fund the creation of this kind of standard, and subverting the current payment model is a good way to achieve that. I feel similarly about advertisements: I want a micro-payment model for websites, so I subvert the advertising model by filtering ads. If almost everyone would join me, then the advertising model would fail, and would be replaced by something else, and I bet micro-payments would be the replacement.

    41. Re:First post!! by Myopic · · Score: 2

      Here's the quote you refer to:

      For necrophilia, it might be necessary to ask the next of kin for permission if the decedent's will did not authorize it. Necrophilia would be my second choice for what should be done with my corpse, the first being scientific or medical use. Once my dead body is no longer of any use to me, it may as well be of some use to someone. Besides, I often enjoy rhinophytonecrophilia (nasal sex with dead plants).

      That sounds like a jest to me.

    42. Re:First post!! by bonch · · Score: 1

      Let's see, the in first link he suggests necrophilia with the consent of the deceased sounds fine to him.

      Like I said, RMS advocates having sex with a corpse.

      In the second link he says lowering the age of consent from 16 to 12 might be something to consider.

      Correct, RMS is considering making it legal to have sex with a 12 year old.

      Which part of my post was inaccurate?

    43. Re:First post!! by bonch · · Score: 2

      He also wrote in 2003:

      "[P]rostitution, adultery, necrophilia, bestiality, possession of child pornography, and even incest and pedophilia” [...] All of these acts should be legal as long as no one is coerced. They are illegal only because of prejudice and narrow-mindedness."

      I repeat--he is advocating necrophilia and even possession of child pornography.

    44. Re:First post!! by JabberWokky · · Score: 1

      What are you talking about? He asked a question. Here's a link to the question. Does that help?

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    45. Re:First post!! by GameboyRMH · · Score: 2
      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    46. Re:First post!! by EvanED · · Score: 1

      The only people that really need to look at the standards is the people who implement the standard -- these are the people the standards documents are written for.

      One more group: people who write books and other information for your typical programmer.

      Also language lawyers like me who need ammunition to tell people to stop doing stupid stuff.

    47. Re:First post!! by 93+Escort+Wagon · · Score: 1

      DRM at its finest.

      Also a great example of why Acrobat and Flash are repeatedly used as vectors for malware - Adobe added lots of crap functionality to them that only exists because Adobe hoped to make money off of it, and it offers ZERO benefit to the end user.

      In an of itself, that's not a surprising thing for a corporation to do; but they didn't even give a passing thought to security when they came up with this, and they still are unwilling to admit the model is fundamentally broken and needs to just be terminated and completely rethought.

      --
      #DeleteChrome
    48. Re:First post!! by bircho · · Score: 1

      Maybe someone thinks the standards must be expensive so a thrid party that didn't work on the process must pay too.

    49. Re:First post!! by Guy+Harris · · Score: 1

      The most recognized standards are those you need to pay for.

      Except for the ones that aren't those you need to pay for and the ones that used to be those you need to pay for, but aren't any more.

    50. Re:First post!! by expo53d · · Score: 1

      If the developers who came up with this type of protection think that 48 hours make 4 days, then they have much greater issues than poor document access control.

    51. Re:First post!! by thegarbz · · Score: 1

      48 hours make 4 days

      Nope that's just me and too much eggnog on christmas eve :-)

    52. Re:First post!! by Anonymous Coward · · Score: 0

      you made my day xD

    53. Re:First post!! by Anonymous Coward · · Score: 0

      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.

      Wait, failing to use ISO Standard C is a criminal offense now? Oh no! I should have known better than to use --std=gnu89! Wait, officer, I didn't mean todfsoafhgn32T#"TUC#no carrier

    54. Re:First post!! by ChrisMaple · · Score: 1

      There is a critical difference between advocating for the legality of something and advocating for that thing. I think that abortion is (often, not always) a bad thing which should be legal. I think prostitution is a bad thing which should be legal. I think wasting electricity is a bad thing which should be legal.

      --
      Contribute to civilization: ari.aynrand.org/donate
    55. Re:First post!! by Anonymous Coward · · Score: 0

      Ye-e-e-ess... but the thing about pedophilia is that it inherently involves coercion. While the legal age of consent is necessarily arbitrary, there does exist for every child an age before which they cannot give proper consent. Clinical pedophilia invariably involves children below that age. So arguing that "pedophilia ... should be legal as long as no one is coerced" is basically like arguing that homicide should be legal as long as no one is hurt.

      Of course, given the context of the quote, it doesn't sound like RMS actually believes that raping children should be acceptable as long as they have been adequately groomed for it. He's just listing all the sexual taboos he can think of and not thinking deeply enough about the differences between them. Careless, and rather stupid if he wants his ideas to be taken seriously, but not cause for the FBI to bust his door down and drag him away.

    56. Re:First post!! by belmolis · · Score: 1

      No, RMS does not advocate necrophilia. He says that with the consent of the deceased (which is rarely if ever the case in actual prosecutions) he doesn't see that it should be illegal. There's a big difference between advocating something and thinking that it shouldn't be a crime.

    57. Re:First post!! by assassinator42 · · Score: 1

      Guess we better all switch to Ada...

    58. Re:First post!! by Anonymous Coward · · Score: 0

      My K&R book (Second Edition) was free and still more relevant than this PDF since it will take *years* before the standard is fully adopted by companies and compilers.

    59. Re:First post!! by mqduck · · Score: 1

      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.

      Yeah, speaking of that... what criteria is it meeting to be called an "open standard"?

      --
      Property is theft.
    60. Re:First post!! by Anonymous Coward · · Score: 0

      You linked to the C++ standard...

    61. Re:First post!! by Locutus · · Score: 1

      after Microsoft and their Microsoft Office Open XML(MS-OOXML) _standard_ debacle made the organisation look like a joke, I'm surprised they're still around.

      LoB

      --
      "Anyone who stands out in the middle of a road looks like roadkill to me." --Linus
    62. Re:First post!! by Anonymous Coward · · Score: 0

      Let's see, the in first link he suggests necrophilia with the consent of the deceased sounds fine to him.

      Like I said, RMS advocates having sex with a corpse.

      Not just any corpse and not as his first choice:

      Necrophilia would be my second choice for what should be done with my corpse, the first being scientific or medical use.

    63. Re:First post!! by Jedi+Alec · · Score: 1

      Like I said, RMS advocates having sex with a corpse.

      Incorrect. He's saying that if I decide someone gets to bang my corpse after I pass away it is really none of your business and you should not be able to forbid it.

      Ahhh, freedom. Easy to say one is in favor, right up to the point where people start doing things you find disgusting.

      --

      People replying to my sig annoy me. That's why I change it all the time.
    64. Re:First post!! by scribblej · · Score: 1

      You got +5 funny, but as someone who has to buy his share of ISO documents to get the details of standards in my line of business, they actually ARE signed and numbered, with my name on every page and a notice that says the PDF is for me only and giving it to anyone else is a violation of copyright and such. Really annoying.

    65. Re:First post!! by Tubal-Cain · · Score: 1

      If, I mean WHEN, they want an authoritative answer to some question about the language, they need the standard. Anything else is just an opinion.

      Usually the compiler's opinion is all that matters to developers.
      If the compiler is wrong, it's a bug for the compiler writers to fix.

    66. Re:First post!! by bonch · · Score: 1

      "Necrophilia would be my second choice for what should be done with my corpse, the first being scientific or medical use. Once my dead body is no longer of any use to me, it may as well be of some use to someone." -- Richard Stallman

    67. Re:First post!! by bonch · · Score: 1

      He is advocating the legalization of necrophilia. This isn't about some bogus freedom argument. It's about a guy who advocates the legalization of things like child pornography possession (note that you didn't address that part) and how he is therefore a poor spokesperson to get behind.

    68. Re:First post!! by bonch · · Score: 1

      If you're advocating for the legalization of an act, you are advocating for the act. Just like if you are advocating for gay marriage, you are a gay marriage advocate, or if you advocate for the legalization of marijuana, you are a marijuana advocate..

    69. Re:First post!! by Anonymous Coward · · Score: 0

      Plus, if you advocate for stupidity, you are stupid. You are advocating for stupidity.

    70. Re:First post!! by Zero__Kelvin · · Score: 1

      I'm glad you quoted it, so everyone could see how ridiculous it is to conclude that his comment advocates and/or promotes necrophilia. You should learn about rhetoric so you don't make a fool of yourself in the future.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    71. Re:First post!! by MikeBabcock · · Score: 1

      Having an age of consent so high in the USA makes consenting adolescents criminals when they fool around on a date. I'm frequently amazed by the backward view the USA has on this subject.

      --
      - Michael T. Babcock (Yes, I blog)
    72. Re:First post!! by MikeBabcock · · Score: 1

      Trying to teach rhetoric to idiots is like trying to sell tanning beds to fish.

      --
      - Michael T. Babcock (Yes, I blog)
    73. Re:First post!! by Anonymous Coward · · Score: 0

      Wrong. I'm Dutch, have been representing the Netherlands at ISO, and studied political science so I can even coment on the law side.

      First off, your taxes didn't pay for it. The Dutch member body (NNI) is financed primarily through the sales of standards and industry contributions. State subsidies were almost zero 3 years ago, before the recent budget cuts. So these PDF sales are in fact quite important. Or is your boss going to just donate money to the NNI?

      Secondly, an ISO standard doesn't have the force of law, not at all. There's one standard that does, and that's NEN 1010 - the national electric installation code, not an ISO standard. Sure, if you violate ISO standards, you might end up being sued for shoddy workmanship. But that's regular civil law. Doctors violating best practices are similarly sued, and medical best practices aren't law either.

    74. Re:First post!! by jeremyp · · Score: 1

      If you talk to a C coder and ask him were his/her copy of C99 is, the chances are he or she won't have one. The standard is not needed to program in C. The only time I ever consult the standard (or rather: the most recent free draft of the standard) is when answering questions on Stack Overflow.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    75. Re:First post!! by not+a+serious+person · · Score: 1

      That download link is for C++11, not C11 (that's why the file is 14 MB).

    76. Re:First post!! by Anonymous Coward · · Score: 0

      You couldn't be more wrong. I advocate for the legalization of marijuana not because I think people should do it, but because it would be better if it were legal.

      P.S. This is just one more subject for which your sub-90 IQ brain comes up with the absolutely wrong answer. Just kill yourself now and do the world a favor.

  2. Re:At least... by symbolset · · Score: 1

    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.

    --
    Help stamp out iliturcy.
  3. Re:At least... by the_B0fh · · Score: 2

    Why would Dennis Ritchie have anything against it?

  4. Let's get C99 right first by JDG1980 · · Score: 2, Informative

    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.

    1. Re:Let's get C99 right first by wdef · · Score: 4, Informative

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

    2. Re:Let's get C99 right first by Daniel+Phillips · · Score: 5, Interesting

      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.

      --
      Have you got your LWN subscription yet?
    3. Re:Let's get C99 right first by nzac · · Score: 2

      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.

    4. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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.

    5. Re:Let's get C99 right first by Anonymous Coward · · Score: 1

      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 ...

    6. Re:Let's get C99 right first by Feltope · · Score: 4, Insightful

      COBOL is king, always will be.

      Solid and reliable code that works period!

      --
      thanks, Feltope
    7. Re:Let's get C99 right first by Dwedit · · Score: 1, Redundant

      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.

    8. Re:Let's get C99 right first by mwvdlee · · Score: 1

      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.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    9. Re:Let's get C99 right first by nzac · · Score: 0

      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.

    10. Re:Let's get C99 right first by peppepz · · Score: 2
      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.

    11. Re:Let's get C99 right first by hairyfeet · · Score: 3, Insightful

      Don't forget to use the magic uncripple settings 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.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    12. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

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

    13. Re:Let's get C99 right first by JDG1980 · · Score: 4, Insightful

      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.)

    14. Re:Let's get C99 right first by JDG1980 · · Score: 3, Informative

      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.

    15. Re:Let's get C99 right first by Anonymous Coward · · Score: 1

      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...

    16. Re:Let's get C99 right first by tapspace · · Score: 2

      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?

    17. Re:Let's get C99 right first by Anonymous Coward · · Score: 4, Informative

      "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.

    18. Re:Let's get C99 right first by kthreadd · · Score: 3, Insightful

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

    19. Re:Let's get C99 right first by Shinobi · · Score: 0

      "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.

    20. Re:Let's get C99 right first by Freestyling · · Score: 4, Interesting

      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#?

    21. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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.

    22. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

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

    23. Re:Let's get C99 right first by Anonymous Coward · · Score: 1

      I'll take C# over C any day

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

    24. Re:Let's get C99 right first by Anonymous Coward · · Score: 3, Informative

      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.

    25. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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.

    26. Re:Let's get C99 right first by rev0lt · · Score: 4, Interesting

      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.

    27. Re:Let's get C99 right first by Richard_at_work · · Score: 4, Interesting

      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?

    28. Re:Let's get C99 right first by rev0lt · · Score: 4, Informative

      Actually, C# is as proprietary as C - it isn't. Check http://msdn.microsoft.com/en-us/netframework/aa569283 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).

    29. Re:Let's get C99 right first by beelsebob · · Score: 1

      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.

    30. Re:Let's get C99 right first by beelsebob · · Score: 0

      Actually, clang is more like the bar these days.

    31. Re:Let's get C99 right first by DarwinSurvivor · · Score: 1

      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

    32. Re:Let's get C99 right first by rev0lt · · Score: 1

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

    33. Re:Let's get C99 right first by wzzzzrd · · Score: 1

      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?

      --
      On second thought, let's not go to Camelot. It is a silly place.
    34. Re:Let's get C99 right first by TheRaven64 · · Score: 3, Informative

      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.

      --
      I am TheRaven on Soylent News
    35. Re:Let's get C99 right first by equex · · Score: 1

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

      --
      Can I light a sig ?
    36. Re:Let's get C99 right first by shutdown+-p+now · · Score: 4, Informative

      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.

    37. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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.

    38. Re:Let's get C99 right first by shutdown+-p+now · · Score: 1

      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.

    39. Re:Let's get C99 right first by Clueless+Moron · · Score: 1

      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

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

    40. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

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

      There isn't any. People who claim otherwise are trolls who have never done any OS programming.

    41. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Unfortunately, many programs have to care about MSVC. Usually, you end up writing compatibility implementations of things they're lacking (yay pstdint.h http://www.azillionmonkeys.com/qed/pstdint.h) and turn them on/off at need.

      I really wish Microsoft would bundle clang with Visual Studio - as far as I know there would be no license issues with doing so, and why pay to develop cl.exe when clang already exists - but I rather doubt Microsoft is institutionally capable of the notion of contributing to the clang project instead of developing their own compiler.

    42. Re:Let's get C99 right first by Shinobi · · Score: 2

      That's because Intel specifically had to introduce the GCCisms(and early on you also needed to patch serious parts of the kernel sources).

      It's still bad though, because you have seriously non-standard stuff. The whole situation is just the same as what people have complained about Microsoft for: Implementing non-standard stuff, but instead of ruthless closed-source for-profit, GCC spread theirs with a draconic ideology and religious zealotry. The GCC project in particular has shown itself to play a serious politics game and favouritism, for example in regards to the PPC970 code submitted first from Apple(declined), then by IBM(Accepted without comment, even if significant parts were the code submitted by Apple earlier).

    43. Re:Let's get C99 right first by tepples · · Score: 1

      Is it wrong to rely on things that were "GCC extensions" before the day in 1999 when C99 passed but have been part of C since C99?

    44. Re:Let's get C99 right first by Holistic+Missile · · Score: 1

      Have you tried adding a space after the 'c' when you search? You might have to put the whole phrase in quotes for this to work.

      --
      When you're dead, you don't know you're dead. It only affects the people around you. Same thing when you're stupid.
    45. Re:Let's get C99 right first by tepples · · Score: 2

      For one thing, you'd need ABI-specific extensions to support the various different calling conventions that different "kinds" of functions have, such as interrupt handlers, 16-bit calls to BIOS to read storage devices before the 32- or 64-bit drivers have fully loaded, etc.

    46. Re:Let's get C99 right first by tepples · · Score: 1

      The pre-release Visual Studio contained in the Windows 8 technical preview won't even allow you to write non-Metro applications

      If you can't get Metro applications anywhere but the Store, then how are you supposed to test Metro applications that you've compiled?

    47. Re:Let's get C99 right first by Shinobi · · Score: 1

      VC and GCC are equally shit at standards compliance *Grumbles*

      If either is specified to be used in a project, it means extra work to adapt existing portable code that is strict ISO C to perform well when compiled with either of them.

      ICC has quite good ISO C compliance, and the whole thing regarding AMD processors not being optimized for was overexaggerated(and there are some technically valid reasons for it: Some of the intrinsics handling involves microcode level, and Intels and AMD's can look very different. So they had the choice of either treating non-Intel as generic x86, or spend a lot of effort writing code for one of their competitors)

    48. Re:Let's get C99 right first by tepples · · Score: 1

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

      So is the BIOS or EFI of every computer sold on the mass market. So is the software running on the microcontroller in your computer's mouse. What workaround do you recommend?

    49. Re:Let's get C99 right first by peppepz · · Score: 1

      I don't know if I understand the question? The version of Visual Studio bundled with the Windows 8 technical preview appears to compile and run Metro applications just fine. It probably contains a developer's certificate that you can use to self-sign applications that will only run on your computer - it told me something like that the first time I started it, but I didn't investigate further.

    50. Re:Let's get C99 right first by tepples · · Score: 1

      It probably contains a developer's certificate that you can use to self-sign applications that will only run on your computer

      But how much will those developer's certificates cost once Windows 8 goes RTM? Enough to discourage high school students from taking up programming as a hobby-leading-to-a-potential-career, I'd wager.

    51. Re:Let's get C99 right first by HarrySquatter · · Score: 1

      Yes, but for C89 it is a GCC extension.

    52. Re:Let's get C99 right first by HarrySquatter · · Score: 1

      Great and you do realize you can still continue to use C89 and C99, right? They don't magically disappear due to this.

    53. Re:Let's get C99 right first by Goaway · · Score: 1

      Oh god is that true? If there is one thing I want in this world, it's to ditch Mingw once and for all.

      It used to be a good and simple C compiler for Windows. It was actually "minimalist". Now it's trying to replace cygwin, and it spews DLLs everywhere, and it can not even be normally downloaded with a reasonable amount of effort, you have to use their custom downloader.

      It's a fucking joke, is what it is.

    54. Re:Let's get C99 right first by Goaway · · Score: 2

      Declaring variables at the beginning of their scope makes the code more readable and easier to debug.

      Not even a little! It does the absolute exact opposite!

      Why on earth would it make code more readable to declare a variable away from the place where it is actually used? That makes no sense whatsoever.

    55. Re:Let's get C99 right first by Shinobi · · Score: 0

      The whole thing regarding ICC only doing SOME optimizations for CPU's flagged as Intel was vastly overblown, and there were valid technical reasons to do so, concerning the fact that some of the optimizations regarding intrinsics involve microcode level, which can cause crashes in worst case, or even giving incorrect data only noticed later

      Fact remains, ICC was used even for AMD processors despite that, in HPC, because it was better than the competition.

    56. Re:Let's get C99 right first by Rockoon · · Score: 1

      ICC has quite good ISO C compliance, and the whole thing regarding AMD processors not being optimized for was overexaggerated(and there are some technically valid reasons for it: Some of the intrinsics handling involves microcode level, and Intels and AMD's can look very different. So they had the choice of either treating non-Intel as generic x86, or spend a lot of effort writing code for one of their competitors)

      You appear to not have a single fucking clue what you are talking about. Microcode level? You think ICC outputs microcode? What the fuck dude..

      Compilers emit instructions, aka machine code. The processor decodes instruction into micro-ops, aka microcode. Compilers do not emit micro-ops. The processor cannot decode micro-ops.

      It wasnt that ICC didnt optimize for AMD. It was that ICC intentionally emitted code that crippled performance on AMD's. Intel was convicted of doing this in a court of law.

      I'm sure Intel appreciate the blind devotion of someone that will make declarative statements about things they obviously dont have even an inkling of a fucking clue about as a means to defend them. I mean fucking seriously... turn in your geek card while you are bent over for them.

      --
      "His name was James Damore."
    57. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Maybe your scope is too big.

    58. Re:Let's get C99 right first by TheRaven64 · · Score: 1

      Yes, it's true (looks like the GNU fanboys have mod points today). Clang can build in Visual Studio, but there are still some rough corners to it. A few of the ReactOS developers and some Sony people are now actively working on LLVM / Clang in Windows, so it's likely to improve a lot in the 3.1 timeframe. Currently the big missing things are support for Microsoft's non-standard template instantiation (which means it can't quite parse all of the Windows C++ headers, only the C ones) and support for exceptions. Both of these are in progress.

      --
      I am TheRaven on Soylent News
    59. Re:Let's get C99 right first by ongelovigehond · · Score: 1

      Nothing wrong with using extensions if you're only going to use GCC anyway. Some of the stuff you can do with extensions are very hard to do without them.

    60. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      The Intel compiler puts MS's compiler in the dust when it comes to optimization. If I had to choose a compiler for standards compliance, I'd go with gcc. If I had to pick something to squeeze performance out of x86/amd64 binaries, I'd go with icc.

    61. Re:Let's get C99 right first by Goaway · · Score: 1

      I'd really like to set up a stand-alone clang for building Windows C applications, but apparently there are no binaries of 3.0, and all the instructions assume you want to build on mingw and then install it in the mingw environment.

      Do you have any pointers to how to go about ditching mingw entirely?

      It sure would be nice if someone would take the time to package it up for standalone use on Windows...

    62. Re:Let's get C99 right first by Goaway · · Score: 1

      (I'd also like to build Objective-C on Windows, but that is probably a taller order. Getting GNUstep to play nice with it might take some doing, I suspect, especially since GNUstep on Windows seems to be pretty neglected.)

    63. Re:Let's get C99 right first by Goaway · · Score: 1

      Maybe it isn't.

    64. Re:Let's get C99 right first by Shinobi · · Score: 1

      *sighs* Yes, ICC can actually work on microcode level, and yes, CPU's can decode microcode.

      How else do you think microcode patches are made for CPU's to work around bugs in the instruction set?

      Hint: It's loaded at boot time, from flash RAM, and those patches are made, for example, in ICC. ICC has some optimization tools that can analyze the flow of the microcode in some intrinsics.

      Hell, a lot of projects have microcode specifications, and both Intel and AMD regularly submit such references to Linux as can be seen here: http://comments.gmane.org/gmane.linux.kernel/1204282

      As for your incorrect claim about the AMDvsIntel issue, everything hinged on the CPUID check. Anything Intel had a valid entry in the database, anything non-Intel might have been compatible, there just wasn't an entry for it, and was thus treated as generic x86.

      Another incorrect point, they weren't convicted, they settled out of court, both with AMD and FTC.

      I think you should put your geek card facsimile back into the cereal box you got it from.

    65. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

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

      MS developer tools have gotten very good since the VC6 area. If you're writing in .Net, everything is fantastic. Microsoft's C compiler is still the same one that was used in VC6. It has the same bugs, it doesn't support any of the new standards (they haven't gotten around to implementing C99 yet). They have done tons of improvements to the IDE, but they have literally not touched the code for the C compiler.

    66. Re:Let's get C99 right first by HalfFlat · · Score: 1

      On a counterpoint, the engine of a recent simulation project of ours is written in C++ and hand-optimized for speed. It took much more work to get VC 2008 to produce tight code than it did for g++ 4.5, and even then, the g++ compiled code ran a bit faster. (The code has a mix of fp and integer work, and the core of it and working set are small enough to fit comfortably in L2 cache; there are some unpredictable branches in tight loops too, for good measure.)

    67. Re:Let's get C99 right first by Shinobi · · Score: 1

      Yeah, the FSF cultists are in full swing today. Had a post of mine modded down for daring to speak out against GCC-specific extensions, and the fact that FSF fans are hypocrites about standards compliance.

    68. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Please also remember to leave the geek card at the lobby.

    69. Re:Let's get C99 right first by TheRaven64 · · Score: 1
      The CMake build system for LLVM / Clang can produce a visual studio project file, so you can build the compiler with that.

      GNUstep is very much actively developed on Windows (although I don't have a Windows machine to test on, so reports of what breaks when you try to build the runtime are welcome). There's now a Windows theme that uses the Widnows UXTheme engine. I think it's the default with the latest Windows installer (which may still ship with gcc for some silly reason).

      I don't test with Windows, as I said, but on FreeBSD we now support a superset of the Objective-C features that work on Darwin.

      --
      I am TheRaven on Soylent News
    70. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      As someone whose experience with native Windows coding is brief and nearly a decade ago, does Windows support OpenGL any longer? As in real support, rather than claim they do but for all practical purposes you'll need to use DirectX or whatever they're on these days? I'm trying to figure out what platforms are realistic options for making my app cross platform (the core is C, and graphics are increasingly OpenGL, and it runs successfully as a command line app). Windows support isn't that important to me, but it'd be a nice feature to have.

    71. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      If your functions are so long that local variable uses aren't visible in the next page or two, you're doing it wrong.

    72. Re:Let's get C99 right first by VertigoAce · · Score: 1

      The Win8 VS preview is actually one of the "Express" versions (like the existing C# and VB Express versions). In other words, it will be a free download for anybody who wants to build Win8 apps for the Win8 store. You can get the full version of VS 11 here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27543.

    73. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      It wasnt that ICC didnt optimize for AMD. It was that ICC intentionally emitted code that crippled performance on AMD's. Intel was convicted of doing this in a court of law.

      Not exactly. They had a CPU detection function that activated different code based on supported CPU features. But, they only listed their own CPUs in the detection routine, and didn't check for AMD's, so activated no CPU-specific optimizations on AMD chips. This is dishonest, because it's completely the wrong way to do it: you're supposed to check for feature bits, not specific CPUs, as both Intel and AMD say to do in their own optimization manuals.

    74. Re:Let's get C99 right first by DarwinSurvivor · · Score: 1

      Just to clarify, this issue is with the search feature built into MSDN, and yes, we tried EVERY *(#&$# combination of spaces, apostrophes, quotation marks, you name it. NOTHING worked. In the end, we just resorted to good old Google "search terms site:msdn.microsoft.com". The really infuriating part is that all of their API entries are categorized by language, version, etc, however there is absolutely NO way to filter a search on their site by any of the categories.

    75. Re:Let's get C99 right first by bonch · · Score: 1

      One part of the new standard is that certain features introduced in C99 are now marked as optional and can be checked with a macro.

    76. Re:Let's get C99 right first by bonch · · Score: 1

      In the modern world GCC is the bar by which Microsoft is measured, and usually found lacking.

      No, it's not. Do Slashdotters really believe this? Clang/LLVM is the driving free-as-in-speech compiler suite these days.

    77. Re:Let's get C99 right first by bonch · · Score: 1

      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.

      Microsoft has completely embraced native code in Windows 8, and you can write C++ Metro applications.

    78. Re:Let's get C99 right first by MightyYar · · Score: 1

      Microsoft Research has an interesting project called Singularity -

      Isn't this what "Longhorn" was supposed to be? Isn't this the reason that we still have XP? It makes sense that they didn't throw it all away.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    79. Re:Let's get C99 right first by MightyYar · · Score: 1

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

      ANY day? Managed code is awesome, but sometimes you need hardware access or more speed.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    80. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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.

      So use a different compiler. There are plenty to choose from even on Windows. Find one which supports the feature you require or work around it.

    81. Re:Let's get C99 right first by gparent · · Score: 1

      Which proprietary language are you talking about in that sentence? You didn't name any.

    82. Re:Let's get C99 right first by hairyfeet · · Score: 1

      I'm afraid you have been misinformed. you see, which has been documented (and was turned over to AMD's attorneys and was rumored to be part of why Intel quickly settled for 1.25 BILLION) quite extensively here the way Intel had their compiler rigged (which they do to this very day BTW, now they simply document it) is this:

      1.-Any and all code compiled with the Intel compiler unless patched beforehand not to shall look at the CPUID for Genuine Intel. 2.- If Genuine Intel found run all optimization including the latest SSEs 3.- If not Genuine Intel drop code to slowest code path, X87 mode which ties a boat anchor to the program, to the tune of 40%+.

      The smoking gun, the one that proves you've been misinformed is simply this: If Intel was only afraid of an incomplete SSE then why did They cripple the Pentium III as well as AMD hmmm? Surely the ones that INVENTED the Pentium III would know which SSEs it truly supported yes? It was actually a simple answer: At the time benchmarks had the PIII stomping the early P4s by as much as 30% in some tasks, but guess what happened after the cripple code got put in? Why suddenly the P4 is WINNING by 30%! Isn't that amazing?

      You've been had friend, hell you are being had to this very day every time you look at a benchmark. Even one of the netbook sites I was looking at the reviewer posted "For some reason the Atom benches higher than the E series AMD chips, but real world tests don't seem to bear the benches out" well no shit because thanks to Intel the benches might as well be named Quack.exe! Hell don't believe me, run a benchmark on your I'm sure Intel CPU then use one of the many tools out there that will let you fake a different CPUID and watch what happens!

      --
      ACs don't waste your time replying, your posts are never seen by me.
    83. Re:Let's get C99 right first by rev0lt · · Score: 1

      It seems Singularity has no actual relation with the Windows line of operating systems. There are several other OS projects written in managed code (Cosmos, Phantom, SharpOS), but yes, Longhorn was an attempt (a sad sad one) at building a OS with most system services written in managed code. I think most of the kernel itself was still C/C++, but many/all the system services were clearly rewritten in .NET. But, comparing it to XP or Vista is kind of unfair - Longhorn was resource-hungry at a time where most current desktops were crappy P4 with about 1GB of RAM, and when Vista came out, a regular desktop would have a dual-core CPU with 2GB of RAM. It's a bit like saying XP is bad because it was slow on your P3 450Mhz with 256Mb of memory...

    84. Re:Let's get C99 right first by hamanu · · Score: 2

      The BIOS is allowed to patch the cpu microcode. applications are not. Allowing an application to patch the cpu microcode would be a security flaw. icc does not emit microcode. Maybe you mean to say it can do microcode-aware instruction scheduling.

      --
      every _exit() is the same, but every clone() is different.
    85. Re:Let's get C99 right first by mrchaotica · · Score: 1

      I'm going to agree with what the AC said: if there's that much code between the variable declaration and the lines where you use it, then your function is too big and you need to subdivide it for readability's sake.

      Functions are like UNIX programs: they ought to do exactly one thing each.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    86. Re:Let's get C99 right first by Goaway · · Score: 1

      Even for a function of a handful of lines, it is much more readable if variables are declared where they are used.

    87. Re:Let's get C99 right first by Goaway · · Score: 1

      Well, it was a year or so since I last tried GNUstep on Windows, but back then it didn't even support native exceptions, and I got the impression after asking around that nobody was in the least interested in doing anything about it. Hopefully that has changed since.

      Anyway, ideally I don't want to build anything, I want something to install and get going. It's not like I can't get it built if I really need to, but if I have to keep building things myself, any increase in convenience is going to evaporate pretty quickly. (And I'd really like to have something I can tell other people to install, too, when they need a compiler.)

      And if there's one thing I've learned after all these years, it's that the bigger the project, the less I want to try and build it, because something will break.

    88. Re:Let's get C99 right first by MightyYar · · Score: 1

      Interesting, because I always said that XP was a pig :)

      In all seriousness, it had very little new functionality over 2000, but it ran noticeably slower on commodity hardware of the day. Now, on modern commodity hardware, it positively screams! That doesn't make it any less bloated, though. At least Windows 7 comes with some interface modifications tacked on to all that bloat.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    89. Re:Let's get C99 right first by EvanED · · Score: 1

      I've actually wanted to do some tests about that actually, and I might have a little spare time coming up. What I don't know is what programs to test with... I've got one or two pieces of software from my research group I might be able to trick up, but does anyone have any other suggestions for programs which build under both MSVC and MinGW without too much pain?

    90. Re:Let's get C99 right first by Forever+Wondering · · Score: 2

      The Intel compiler puts MS's compiler in the dust when it comes to optimization. If I had to choose a compiler for standards compliance, I'd go with gcc. If I had to pick something to squeeze performance out of x86/amd64 binaries, I'd go with icc.

      icc is a bit touchy about the amd thing. It tends to optimize for intel and the resulting code may be sub-optimal for amd because icc knows exactly the internal implementation of the x86 arch on an intel chipset.

      There was a time (circa gcc 2.96) that icc produced vastly better code than gcc. However, gcc got a complete makeover starting with 4.0.x [punting on LALR grammar parsers and doing recursive descent, virtual register optimizing, etc.] and the code that it produces is pretty close to optimal as far as I can determine [I'm concerned with speed, so I disassemble a lot to be sure].

      Also, icc is x86 specific. Whereas gcc does a plethora of arch's. There is a disincentive [for intel] to make icc multiarch.

      --
      Like a good neighbor, fsck is there ...
    91. Re:Let's get C99 right first by TheRaven64 · · Score: 1

      As I said, it doesn't yet support Win64 exceptions, although it's a work in progress. It will not support Win32 SEH, because it is patented and the patent doesn't expire for another few years (by which time I doubt anyone will care about win32) and the patent is quite aggressively enforced.

      --
      I am TheRaven on Soylent News
    92. Re:Let's get C99 right first by man_of_mr_e · · Score: 1

      That's probably because very few people write standard C anymore. Many write procedural C++ without issues. If there was a demand for it, MS would probably add it as a feature.. so demand it.

    93. Re:Let's get C99 right first by Goaway · · Score: 1

      I didn't mean Win64 exceptions, I meant Objective-C exceptions like @try/@catch, on any version of Windows.

    94. Re:Let's get C99 right first by Guy+Harris · · Score: 1

      Hint: It's loaded at boot time, from flash RAM, and those patches are made, for example, in ICC.

      "Made in ICC" in what sense?

      ICC has some optimization tools that can analyze the flow of the microcode in some intrinsics.

      Presumably meaning the tools know about the internal implementations, on various processors, of instructions generated from the intrinsics, whether they're microcoded or not. If so, stating it that way might have not have provoked that response.

    95. Re:Let's get C99 right first by Guy+Harris · · Score: 1

      This is dishonest, because it's completely the wrong way to do it: you're supposed to check for feature bits, not specific CPUs, as both Intel and AMD say to do in their own optimization manuals.

      I infer, perhaps incorrectly, from what Shinobi said that in some places they were checking for implementations, not for features, because, in some cases, for a given intrinsic that could expand to more than one sequence of code, even though both sequences of code could work on processors A and B, one sequence would be better on processor A and another sequence would be better on processor B.

    96. Re:Let's get C99 right first by Guy+Harris · · Score: 1

      some of the optimizations regarding intrinsics involve microcode level, which can cause crashes in worst case, or even giving incorrect data only noticed later

      Meaning that ICC, or ICC-generated code, will load new microcode for some instructions?

    97. Re:Let's get C99 right first by gnasher719 · · Score: 1

      Well, it was a year or so since I last tried GNUstep on Windows, but back then it didn't even support native exceptions, and I got the impression after asking around that nobody was in the least interested in doing anything about it. Hopefully that has changed since.

      According to Apple, whenever an exception is thrown in Objective-C code, it is a bug in your code that needs fixing. This is mostly because ARC (automatic reference counting) will have problems when exceptions are thrown.

    98. Re:Let's get C99 right first by Guy+Harris · · Score: 1

      some of the optimizations regarding intrinsics involve microcode level, which can cause crashes in worst case, or even giving incorrect data only noticed later

      Meaning that ICC, or ICC-generated code, will load new microcode for some instructions?

      Or that ICC will generate code, for certain processors, that is not valid for the x86 architecture, and might crash or give incorrect data on some processors, but, on other processors, is known (because the developers at Intel know how the microcode works on those processors) to work as desired (presumably even in the face of microcode updates) and known to be faster than the architecturally-correct code?

    99. Re:Let's get C99 right first by TheRaven64 · · Score: 1

      They will be implemented in terms of Win64 exceptions when Win64 exceptions are supported. They aren't currently. We could emit DWARF EH data for them, but there's no real point because then you'd need to ship a complete unwind stack for them. GCC emits setjmp / longjmp exceptions, but if you're going to use them you may as well use NS_DURING. I don't intend to support them, because once they're working (for a given value of working), people think implementing exceptions properly is a lower priority and it gets put off for years.

      --
      I am TheRaven on Soylent News
    100. Re:Let's get C99 right first by gnasher719 · · Score: 1

      The smoking gun, the one that proves you've been misinformed is simply this: If Intel was only afraid of an incomplete SSE then why did They cripple the Pentium III as well as AMD hmmm?

      The correct behaviour would be to check the feature flags and use features if present, except if it was known that using the feature would be slower. It would also be correct for Intel to completely ignore AMD processors. With real AMD processors, this would produce code that works, and is usually fast.

      Now _if_ there were AMD processors that set a feature flag without actually implementing the feature properly, then it would be correct for Intel to produce code that misbehaves on these AMD processors; any misbehaviour would be AMD's fault. And _if_ selecting the fastest code using an algorithm that checks just feature flags and known Intel processors were to produce slow code for AMD, that would be just tough for AMD. But intentionally using the slowest code after testing that the processor is an AMD processor, that is wrong.

    101. Re:Let's get C99 right first by Goaway · · Score: 1

      Well, I kind of have a pretty large codebase full of @try and I am not about to rewrite it, so as long as they are not supported GNUstep is useless to me.

    102. Re:Let's get C99 right first by Haeleth · · Score: 1

      No, it's not. Do Slashdotters really believe this? Clang/LLVM is the driving free-as-in-speech compiler suite these days.

      Hahahahahahahahahahahahaha.

      Clang is the up-and-coming challenger, and it looks pretty inevitable that it's going to win eventually. But the world moves slower than you might like. Right now, clang is so far from taking over from GCC that it's not even funny.

      Just because Apple uses something doesn't mean it dominates everything else in the world. Everywhere I look that isn't Apple, I see either GCC or ICC. In much of industry, people are only just starting to migrate from old vendor compilers to GCC as part of the slow ongoing UNIX-to-Linux shift.

    103. Re:Let's get C99 right first by Haeleth · · Score: 1

      "For a decades-old version of the standard that was made obsolete before the end of the last millenium, ..."

      I don't even know what you're trying to argue. Mixed declarations and code is standard C and has been for over a decade. It is not a GCC extension. It is a basic part of the standard C programming language that any modern compiler should implement.

    104. Re:Let's get C99 right first by hairyfeet · · Score: 1

      Exactly and you are 100% correct except that isn't what Intel did because they frankly didn't give a wet fart about producing the fastest code but crippling the competition since the ICC was known to be used (and still is BTW) on most benchmarking software!

      What amazes and saddens me is frankly how badly /. has become infected by rampant fanboyism and flag waving. Doesn't ANYONE remember "Windows isn't done unless lotus won't run"? if this were MSFT putting in a code that made GPL code run like dogshit wouldn't everyone have a fit? wouldn't they be screaming for boycotts or calling for an antitrust investigation?

      Well here have a company that not only bribed OEMs, one of which testified that Intel kickbacks were "like cocaine" and during the price wars there were several quarters where the ONLY profits Dell made were in the form of Intel kickbacks, if that wasn't enough they rigged their compiler to cripple the chips they didn't make or like and then lied their sorry asses off about it! look at the blog i linked to, he has emails straight from intel going back years where first they outright lie and say their compiler isn't doing anything and then when the evidence is shoved in their face they come up with the lame "Oh its just to make sure SSE works" which is complete and total horseshit because if that were the case there would be NO REASON to cripple their own Pentium III!

      No my friend this is rigging the market plain and simple. it isn't like the SSE opcodes are a secret, it would be trivial to have the code check for the SSE flag and then simply run the appropriate SSE for the CPU. AMD has had the SSE 1 through SSE 3 as intel for several years now and the ONLY differences between them is SSE 4. So they could run completely safely on SSE 1- 3 and there would be NO argument from anybody, but they don't.

      As I said the smoking gun that proves this was and is market rigging is the Pentium III. At the time the code rigging was first detected in ICC the Pentium III was stomping the P4 by a good 30% on many tasks but after the ICC rig magically their own Pentium III lost to the P4 by 40% even though we are talking the SAME chips on the SAME machines and the ONLY difference was the cripple code.

      I was a lifelong Intel man, going back to the 386sx but after reading of this and looking at the evidence i can't in good conscience condone such behavior by buying a damned thing from a company that so blatantly rigs the market in such a matter. if you win because you have a better chip fine and dandy i'm happy for you. But as it is now we frankly can't use ANY of the most used benchmarks because they tie a boat anchor to non intel CPU as that netbook reviewer found out when trying to compare the Atom 525 to an E-350. Even though we all know that as an in order CPU the Atom is gonna lose to an out of order CPU of similar speed the benches consistently show the Atom as faster simply because of the cripple code.

      In the end it comes down to this: They KNEW the Pentium 4 netburst arch was a turkey but they had nothing in the pipeline and they KNEW in a free market the one that had the better chip would win so they simply rigged the market to their favor. Now that they have (possibly because again we can't use benchmarking software and the only fair tests would be programs known to be compiled with GCC) a faster CPU they have simply kept the cripple code because it makes their chips look that much faster and lets them charge a higher premium. they should be busted for filing false statements, for presenting false data for every Intel CPU bought by the US gov, and they should be busted under Sherman antitrust both for the cripple code and for bribery. its just THAT simple and if any other company would have done it we'd be asking for their heads!

      I may not be able to do much but at least i can highlight the lies when i see them and not a single new Intel chip will come through my shop.;

      --
      ACs don't waste your time replying, your posts are never seen by me.
    105. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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.

      Are you sure you're talking about the same people in both of those clauses?

      The Linux kernel is horribly tainted in that way.

      Do you think the primary Linux kernel developers ought to be classed as "FSF supporters"?

    106. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Try TDM-GCC. It's MinGW but repackaged in a single file, no more fucking around with their downloader. Yeah, I hate it, it never works.

    107. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Enough to discourage high school students from taking up programming as a hobby-leading-to-a-potential-career, I'd wager.

      You mean "enough to encourage high school students to take up programming using non-Microsoft platforms", so I think it's rather unlikely that MS would actually do that.

    108. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Whatever else you say about Microsoft, the optimizer in the Visual C/C++ compiler is best described as a "badass mofo."

    109. Re:Let's get C99 right first by rev0lt · · Score: 1

      My desktops at the time all had (at least) 128MB of RAM, so XP actually felt faster than W2K. USB 2.0, System Restore, prefetch improvements, and ClearType were more-than-enough reasons to want to run XP at the time.
      It should be noted that the hardware requirements for W7 are about the same as Vista Premium, and it feels a lot snappier. I haven't used much Vista (went from xP64 to W7 64), most machines with it were third party computers.

    110. Re:Let's get C99 right first by Haeleth · · Score: 1

      OK, let's refine the statement, then: you should not use MSVC if you can avoid it because it is non-free and perfectly usable free alternatives are readily available.

      Seems quite reasonable and consistent now. The alternatives are also better, since they implement C language features standardized less than 20 years ago!

    111. Re:Let's get C99 right first by Haeleth · · Score: 1

      And safer, too, since it means you can always see at a glance that every variable is being initialized properly before it's used.

      (Also it is not always possible, or even desirable, to break code into functions of a few lines. Anyone who claims otherwise is a puritan fanatic whose assertions should be taken with a very large pinch of salt; it is unlikely they have experience with a broad range of complex real-world programming situations.)

    112. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      What!?! This got modded up?

      "...MS make their proprietary C# language easy, and C hard work."

      MS doesn't make C hard work, the language already does that on its own. Besides, MS can't make C any easier because then the Slashbots would cry about how MS is adding proprietary extensions. Ditto for C++.

      Ever tried writing a kernel mode driver in C#?

      Why the hell would anyone want to do that? C#, or more precisely, .NET brings a lot of goodies for application development. If you are doing kernel mode development then chances are you don't need to send email, make HTTP requests, write sophisticated GUIs, communicate with a RDBS, get data from Flickr or Facebook, etc. C/C++ is pretty much all you need.

    113. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Actually, C# is as proprietary as C - it isn't. Check http://msdn.microsoft.com/en-us/netframework/aa569283 for the ISO standard details regarding C#.

      If cared to read it, you would have realized that Microsoft only cared to standardize until version 2.0. Since then, no more updates have been provided. C# is proprietary.

    114. Re:Let's get C99 right first by TheRaven64 · · Score: 1

      If Windows exception support is valuable to you, then I suggest that you consider contributing. Until Sony decided to adopt LLVM, no one within the project regularly used Windows, and no one outside was willing to fund the work. Supporting features on platforms that I don't use (and, in this case, don't even have access to) are generally a very low priority for me.

      Native exceptions work fine on platforms I use, like FreeBSD, platforms people who have sent me helpful bug reports use, like OpenBSD, and platforms used by people who paid me for support, like Linux.

      --
      I am TheRaven on Soylent News
    115. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      I use the mingw as a cross compiler on Linux. At least Debian has made the packaging rather painless. Simply setting CC=i586-mingw32msvc-gcc (or something like that) will make many things work pretty well.

    116. Re:Let's get C99 right first by Shinobi · · Score: 1

      You have misunderstood exactly what's written on Agner's site.

      "1.-Any and all code compiled with the Intel compiler unless patched beforehand not to shall look at the CPUID for Genuine Intel. 2.- If Genuine Intel found run all optimization including the latest SSEs 3.- If not Genuine Intel drop code to slowest code path, X87 mode which ties a boat anchor to the program, to the tune of 40%+."

      Point 1 you have completely misunderstood, or you are deliberately stating it erronously. What ACTUALLY happens, is that, in the absence of capability flags, either in the makefiles, or passed on the command line, the compiler will do a CPU check, based on CPUID. As for point 2: That step is actually "Run all optimizations as specified in the DB entry for that CPUID". Point 3: And that was the fallback method for any CPU without an entry in the CPUID database, generic x86, which does not include SSE, MMX etc.

      As for the P3 vs P4, at the time, the benchmark programs were typically written in VC6, using MS's compiler, and that included 3DMark, BYTE's own program etc.

      With regards to the Atom and the E-series, owning an E-series, the competition between the Atom and the E-series depends entirely on the task, there's no compiler rigging needed to make either one look bad. In some tasks, the higher clocks on the Atoms win out, especially if you can thread it properly. On other tasks, for example strictly sequencial tasks, the E-series win out, due to better IPC, but their clock is heavily limited. I'm currently trying to ditch my E-350, because it's not quite good enough for what I wanted, and it runs hot as hell when decoding movies on the GPU, even with a fan

      In terms of using the compilers, unlike you, I've used many of them in my work in both embedded and HPC. In HPC, Intel's compiler has been pretty much standard EVEN FOR AMD CPU's, because it generates the fastest code. Yes, even for Opterons etc. And that's empirical use. PGI is not able to compete with their C and C++ compilers, and their Fortran compiler is also slightly behind.

      So come back when you have actually used the compilers, instead of spewing out verbiage proving that all you read is press releases etc.

    117. Re:Let's get C99 right first by Shinobi · · Score: 1

      Question: Do you thus consider the Linux Kernel to be the BIOS? Or Linux utils such as the microcode_ctl tool?

      http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/5.6_Technical_Notes/microcode_ctl.html

      And ICC can do both.

      It just doesn't generate microcode with standard flags.

    118. Re:Let's get C99 right first by Shinobi · · Score: 1

      ""Made in ICC" in what sense?"

      Compiled and output into a microcode dat file, according to the Intel engineer I talked to.

      "Presumably meaning the tools know about the internal implementations, on various processors, of instructions generated from the intrinsics, whether they're microcoded or not. If so, stating it that way might have not have provoked that response."

      It can do both

    119. Re:Let's get C99 right first by Shinobi · · Score: 1

      "Meaning that ICC, or ICC-generated code, will load new microcode for some instructions?

      Or that ICC will generate code, for certain processors, that is not valid for the x86 architecture, and might crash or give incorrect data on some processors, but, on other processors, is known (because the developers at Intel know how the microcode works on those processors) to work as desired (presumably even in the face of microcode updates) and known to be faster than the architecturally-correct code?"

      Meaning that ICC will generate code that is correct for Intels microcode architecture, but not for AMD's for example. Keep in mind, x86 is now _effectively_ an abstraction layer, with the underlying, ACTUAL ISA being the microcode level, where the implementation differs between the vendors. So for example Intels and AMD's FMADD can look the same on x86-level, and called the same, with the same arguments, but on the microcode level they are completely different.

    120. Re:Let's get C99 right first by KZigurs · · Score: 1

      And mine usually do!

      slvewlrdhngr()
      incrcmpnyprfts()
      getmeabonus()

    121. Re:Let's get C99 right first by KZigurs · · Score: 1

      How many C99 compliant (Compliant, not supporting) compilers can you name out there?

    122. Re:Let's get C99 right first by macshit · · Score: 1

      GCC? People still use that? Clang can now parse a lot of the standard windows headers.

      Hmm, why wouldn't people use gcc? Clang certainly has a neat-n-shiny modern source base and shows promise for the future, but for practical purposes gcc is still often the better compiler—by which I mean, optimizes better, is less buggy and more mature, has better standard support, supports more targets, has more developers, etc. Since gcc is what they were probably already using, why would they suddenly change?

      [I do use clang sometimes, especially for making sure my code is portable (clang is an independent implementation, so it's a way to see if I'm depending on any implemenation quirks in gcc), but I don't use clang as my regular compiler because gcc still does a much better job of optimizing in cases I care about, and is less buggy.]

      --
      We live, as we dream -- alone....
    123. Re:Let's get C99 right first by TheRaven64 · · Score: 1

      by which I mean, optimizes better

      If you use OpenMP, or your code benefits from autovectorisation, that's true. If not, then there's usually less than 10% in it, and much of the time LLVM does a better job than GCC.

      less buggy and more mature

      More mature (which means more crufty code), sure. Less buggy? Debatable. I work on one large codebase that don't support any GCC after 4.2 because they've all introduced new optimiser bugs. The same project works with ICC, XLC, Open64, and Clang / LLVM. If you do stick with 4.2.1 (the last GPLv2 one, so the last one you'll find shipped by default on most non-GNU platforms) then you have fun things like internal compiler errors if you use the atomic builtins in large functions because of a buggy register allocator.

      has better standard support

      Again, highly debatable. They're both close with C, although I think Clang has slightly better C11 support. Clang has more standards-compliant template instantiation behaviour for C++. Objective-C doesn't have a standard, but clang is the reference implementation and the only compiler to support nice features like automatic reference counting (and generates much better code for Objective-C than GCC). Trying to support gcc in Objective-C code is now more effort than it's worth.

      supports more targets

      That one is true, although only relevant if you actually use those targets. For example, I don't care about M68K support, because I haven't even seen an M68K machine for years. I do care about MIPS support (which is a little bit immature in LLVM), because there are still MIPS systems that I need to target. I care most about x86[-64] and ARM. Apple and Qualcomm have put a lot of effort into optimising LLVM's ARM back end over the last couple of years, and it generates much better code on ARMv7 than GCC in a lot of cases.

      has more developers

      This one I very much doubt. The GCC team is mostly employed by Google and Red Hat. Google is currently migrating to Clang, and a lot of the Google-employed GCC team is now being paid to work on clang. LLVM has significant contributions from UIUC, Apple, Qualcomm, Google, Adobe, ARM, Intel, AMD, and many others.

      Since gcc is what they were probably already using, why would they suddenly change?

      For one thing, for the significantly better errors. I was 'compiling' C++ code with clang for about a year before it was actually producing working binaries just for the error messages, then compiling with gcc to actually produce the .o files. GCC would print screens full of unintelligible template expansions, Clang would tell me the actual problem. Any problems in macros or templates are a bitch to find with gcc but easy with clang. Once clang was able to produce working binaries for C++, I ditched gcc entirely.

      --
      I am TheRaven on Soylent News
    124. Re:Let's get C99 right first by Guy+Harris · · Score: 1

      Meaning that ICC will generate code that is correct for Intels microcode architecture, but not for AMD's for example.

      In another reply you say "Compiled and output into a microcode dat file, according to the Intel engineer I talked to." This seems to indicate that ICC is generating, rather than x86 instructions, microcode instructions, perhaps meaning uops. As far as I know, no x86 processor can run uops from main memory, so this presumably means that ICC generates microcode to be loaded into the processor's microcode memory.

      Keep in mind, x86 is now _effectively_ an abstraction layer, with the underlying, ACTUAL ISA being the microcode level, where the implementation differs between the vendors.

      And, probably, even between processors from the same vendor, so presumably it would generate microcode only if told which processor was the target processor.

      (Or is this a separate compiler from the ones Intel sells, used internally by the processor development groups when developing microcode for particular processors?)

      So for example Intels and AMD's FMADD can look the same on x86-level, and called the same, with the same arguments, but on the microcode level they are completely different.

      But that doesn't mean the compiler has to generate actual microcode into a .dat file just to use that instruction. It can:

      • generate code that uses FMADD, as specified by the architecture manual, in a fashion that works on multiple processors, without using it in a fashion optimized for specific processors, so it'll work correctly on all processors, regardless of how it's implemented;
      • generate code that uses FMADD, as specified by the architecture manual, in a fashion that works on multiple processors, in a fashion optimized for a specific processor, so it'll work correctly on all processors, regardless of how it's implemented, but might be slower than the previous option's code is on processors other than the one for which it's tuned;
      • generate code that uses FMADD, in ways that the architecture manual doesn't specify as valid, but that happens to work on a particular processor and happens to run faster than code that uses it in a way that the architecture manual specifies as valid;
      • generate replacement microcode for FMADD's implementation (if it's implemented by microcode fetched from internal processor memory rather than implemented by non-reprogrammable hardware generating uops);

      for example.

    125. Re:Let's get C99 right first by Daniel+Phillips · · Score: 1

      More mature (which means more crufty code), sure. Less buggy? Debatable. I work on one large codebase that don't support any GCC after 4.2 because they've all introduced new optimiser bugs

      Specifics?

      --
      Have you got your LWN subscription yet?
    126. Re:Let's get C99 right first by Daniel+Phillips · · Score: 1

      ...VC beats gcc on optimization quality.

      That claim requires support. GCC optimization quality has improved dramatically all through the 4 series. O3 is very impressive.

      --
      Have you got your LWN subscription yet?
    127. Re:Let's get C99 right first by HarrySquatter · · Score: 1

      I'm not arguing anything. GCC adds an extension to C89 that allows mixed declarations and code. Yes, you can use C99 and get this as part of the standard but it doesn't change the fact that it is a GCC extension when not compiling in C99 mode.

    128. Re:Let's get C99 right first by HarrySquatter · · Score: 1

      Oh and you don't even have to take my word for it. From GCC's own documentation:

      5 Extensions to the C Language Family ...
      Mixed Declarations: Mixing declarations and code.

      Fail much, bro?

    129. Re:Let's get C99 right first by MightyYar · · Score: 1

      Yeah, I was able to slim XP down enough to run well - but at the time it ticked me off that I had to turn off services and stuff. I think it was mostly RAM as the performance hit unless you had all the GUI stuff enabled, in which case it was legitimately slower. The thing that forced me to upgrade was that iTunes wouldn't run on 2000 :)

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    130. Re:Let's get C99 right first by Goaway · · Score: 1

      Currently I am bogged down with projects, and Cocotron does already support native exceptions on Windows, so I am pretty much set. I'd like to move to GNUstep so I could build on Windows itself, but that's obviously low priority.

    131. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      Mission Critical stuff might be written in Ada.

    132. Re:Let's get C99 right first by shutdown+-p+now · · Score: 1

      VC and GCC are equally shit at standards compliance *Grumbles*

      I understand that g++ is not perfect, but it's definitely better. For example, it actually supports correct two-pass handling of templates, whereas VC always binds all identifiers at the point of instantiation. More recently, g++ has better C++11 support, too.

    133. Re:Let's get C99 right first by shutdown+-p+now · · Score: 1

      That claim comes mainly from personal experience, but I will readily admit that last time I was in a position to directly compare assembly listings from a large production-quality codebase between g++ and VC was two years ago, and things may have changed since then.

      However, I know that most software for Windows is still built with VC, most importantly games - and I very much doubt that e.g. Carmack would have skipped on the chance to use a better optimizing compiler. So I am reasonably certain that not much has changed in those two years.

    134. Re:Let's get C99 right first by MikeBabcock · · Score: 1

      Knowing Microsoft, I'm shocked there isn't a Visual Basic for Driver Code yet. Just saying.

      --
      - Michael T. Babcock (Yes, I blog)
    135. Re:Let's get C99 right first by hairyfeet · · Score: 1

      Again everyone seems to be selectively ignoring the smoking gun. if ANY of this was actually true, why would the cripple the Pentium III? After all who knows more about what the chip is doing than the vendor that made it?

      The answer is simple and proof of dirty dealing: It simply doesn't have a damned thing about what implementation of SSE does what and is instead a way to cripple the competition in benchmarks and in every program that uses ICC. At the time the cripple code was first released the benchmarks consistently shows the late model P3 STOMPING the early model P4s by as much as 40%. the cripple code is added and voila! On the next release benches on the SAME CHIPS are showing the P4 WINNING by 40%! Wow, isn't that just amazing?

      This is NO different than what MSFT did to DR-DOS and their little "Windows isn't done unless Lotus won't run" gag. the P4 was a disaster, one reviewer (I believed the Register) called in an "marchitecture" as it sacrificed everything so the marketing people could claim clock speed (The MHZ wars) but quickly found out it was useless in mobile and when ramped hit a thermal wall. so instead of accepting they lost this round they rigged the market both by bribing OEMs and with the cripple code. this is why you couldn't hardly find a single OEM with an Athlon chip, only Duron/Sempron, even though athlon was winning awards and competitions. Simply put their kickbacks were tied to how many AMD CPUs you sold and what type, the crappy chips were allowed, Athlon was not. Again no different than how MSFT tied Windows lower price to how many of the OTHER OSes you sold.

      So please don't forget the smoking gun, because it simply blows the entire argument out of the water and makes what SSE the chip has moot. if ANYTHING that you said above was the actual reason then there wouldn't have been a reason for the P3 to have been crippled but it was. That is why Intel coughed up 1.25 BILLION rather than go to court because just that fact alone would have been a slam dunk for AMD.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    136. Re:Let's get C99 right first by Anonymous Coward · · Score: 0

      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?

      Depends on what you mean by mission critical. In my book if it's mission critical and the language starts with the letter C then a bunch of people must have gotten lobotomies.

      Things that fly can't be much more mission critical and are written in Ada. (Boeing 777 for one.)

    137. Re:Let's get C99 right first by Daniel+Phillips · · Score: 1

      So your evidence is anecdotal, perhaps stronger evidence would be in order.

      --
      Have you got your LWN subscription yet?
    138. Re:Let's get C99 right first by shutdown+-p+now · · Score: 1

      We're not in a court of law here. I shared my experience; if you don't find it convincing enough, you can go ahead and make your own measurements.

    139. Re:Let's get C99 right first by Daniel+Phillips · · Score: 1

      I have done extensive measurements and analysis of performance of recent GCC versions with O3 optimization. Overall, I am very impressed. I have not done such analysis of Microsoft's compiler product, and I am unlikely to. However, I am skeptical about your claim that Microsoft's compiler produces better code than GCC at this point in time.

      --
      Have you got your LWN subscription yet?
  5. Re:At least... by Anonymous Coward · · Score: 0

    Microsoft-designed "secure function" cancer?

  6. move on by OrangeTide · · Score: 4, Insightful

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

    --
    “Common sense is not so common.” — Voltaire
    1. Re:move on by mortonda · · Score: 1

      Many of us have never depended on Microsoft for our development tools.

      FTFY

    2. Re:move on by OrangeTide · · Score: 1

      too young to have used any of the BASIC interpreters Microsoft licensed or to have used QBasic?

      kids these days have no respect for their elders.

      --
      “Common sense is not so common.” — Voltaire
    3. Re:move on by Forever+Wondering · · Score: 1

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

      There's a bigger problem. sizeof(int) vs sizeof(long) between GCC/ICC/clang/just_about_anybody and VC.

      When K&R first came out, int's could be either 16 bit or 32 bit and long's were 32 always. ANSI C changed this to short is 16, int is 32, and long is "large enough to contain a pointer".

      MS used the K&R model [with int being 16] because it was stuck on the pre-386 8086's. They wanted int's to be 16 for that. They assumed long's were 32 bit. This is one of the reasons that they have so many abstract types for simple types (e.g. LONG, ULONG, STATUS, etc.). They kept this model going, even during the transition from win16 to win32 (which would have been a good time to change the paradigm).

      The problem occurs when going to a 64 bit architecture. The "long contains a pointer" model works seamlessly (more or less). But, MS, in order to prevent breakage of legacy apps, keeps their 64 bit compiler assuming a "long" is 32 bits. They've created [yet] another set of abstract types to resolve the [obvious] conflict (e.g. NEW_POINTER_DIFF [or whatever] is conditionally defined as a "long long" for 64 bit and "long" (or "int") for 32 bit). They might have a compiler option or pragma that changes this behavior, but since they tend to have their own little world, I'm guessing not.

      Even so, most win32 apps need to use win*.h files. So, even if you're using a non-MS compiler, you still get tripped up by (or have to deal with) the issues surrounding this.

      --
      Like a good neighbor, fsck is there ...
    4. Re:move on by gnasher719 · · Score: 1

      When K&R first came out, int's could be either 16 bit or 32 bit and long's were 32 always. ANSI C changed this to short is 16, int is 32, and long is "large enough to contain a pointer".

      Excuse me, but that is complete rubbish. short is at least 16 bit but can be larger. int is at least 16 bit but can be larger. long is at least 32 bit but can be larger. long long is at least 64 bit but can be larger. There's no guarantee at all that "long" or "long long" can contain a pointer.

      intptr_t is an optional typedef for an integer type that is large enough to hold any data pointer. int8_t, int16_t, int32_t, int64_t are optional> typedefs for integer types with exactly 8, 16, 32 and 64 bits.

    5. Re:move on by Haeleth · · Score: 1

      Age has nothing to do with that. I cut my teeth on 8-bit BASIC, but Microsoft had nothing to do with the implementation. And while I did use Windows for a while in my teens before I matured into a *nix user, those were the days before Microsoft's monopoly abuse had quite destroyed all competition in the markets they chose to enter, so I was able to choose from a range of development tool providers (and chose Borland).

    6. Re:move on by Anonymous Coward · · Score: 0

      I can understand int8_t and company being optional, even if I think it's stupid to amputate the C11 standard for werdass machines that were last build 30 years ago and for which no C11 compiler will ever be written, and if they did, if anything *they* should bend to support it.
      But intptr_t? Really? It takes more than a weird CPU to support pointers as specified in the C standard and yet be unable to store them into an integer type. Just make the result of performing operations on them and then casting them back to pointers undefined. If your integer has to use more than one machine word, well that's your problem, but it's not impossible and it makes large classes of algorithms possible within the standard in a portable way.

    7. Re:move on by Guy+Harris · · Score: 1

      There's a bigger problem. sizeof(int) vs sizeof(long) between GCC/ICC/clang/just_about_anybody and VC.

      When K&R first came out, int's could be either 16 bit or 32 bit and long's were 32 always. ANSI C changed this to short is 16, int is 32, and long is "large enough to contain a pointer".

      No, they didn't. short int is a type the range of which is a possibly-improper subset of the range of int and int is a type the range of which is a possibly-improper subset of the range of long int. I.e., the ANSI C specification does not prevent an implementation of ANSI C from having short, int, and long int from all being 16, or all being 32, or all being 64. It also doesn't prevent a pointer from not fitting into any integral data type (C on the IBM i operating system has, I think, 128-bit pointers).

      What "changed this to short is 16, int is 32, and long is "large enough to contain a pointer"" was the widespread availability of 32-bit processors, where those sizes made the most sense.

      MS used the K&R model [with int being 16] because it was stuck on the pre-386 8086's. They wanted int's to be 16 for that. They assumed long's were 32 bit. This is one of the reasons that they have so many abstract types for simple types (e.g. LONG, ULONG, STATUS, etc.). They kept this model going, even during the transition from win16 to win32 (which would have been a good time to change the paradigm).

      Well, for Win32, they went with int and long int both being 32-bit, just as is the case on UN*X on 32-bit processors (the ILP32 model).

      The problem occurs when going to a 64 bit architecture.

      Yes, for better or worse, they went with the allowed-by-ANSI-C-but-still-annoyingly-different-from-UN*X's-LP64 LLP64 model.

    8. Re:move on by Forever+Wondering · · Score: 1

      No, they didn't. short int is a type the range of which is a possibly-improper subset of the range of int and int is a type the range of which is a possibly-improper subset of the range of long int. I.e., the ANSI C specification does not prevent an implementation of ANSI C from having short, int, and long int from all being 16, or all being 32, or all being 64. It also doesn't prevent a pointer from not fitting into any integral data type (C on the IBM i operating system has, I think, 128-bit pointers).

      The standard requires a ranking char<=short<=int<=long<=long long, so, yes, they could be all the same (but, short can not be larger than int, for example). But, any comp/arch that doesn't provide a base 8/16/32/64 is impractical. Also, char is mandated to be 8 bits. So, to provide the size coverage and honor the ranking requirement, this pretty much locks in char==8,short==16,int==32. Beyond that, all bets are off. Which is why my own code uses [my own] abstract types for anything else (e.g. I have my own intptr_t equiv). But, if you're going to cover a 64 bit number, which most programmers expect to be "long long", this confines "long" to either 32 or 64 bits.

      As to IBM's 128 bit address (which model specifically? some extension of S/390 or of their power* series?), they would need to have an integer type of the same size. If they've gone to the trouble of doing this, they have quite probably implemented an ALU that is just as wide. That is, you need to have something that can index through a byte array. If you can't, then the arch is some segmented variant or is badly broken.

      What "changed this to short is 16, int is 32, and long is "large enough to contain a pointer"" was the widespread availability of 32-bit processors, where those sizes made the most sense.

      Yes, that's my point. What makes the most sense. But, if you don't have an integer type that contains a pointer, you'll have a very hard time with arrays.

      Well, for Win32, they went with int and long int both being 32-bit, just as is the case on UN*X on 32-bit processors (the ILP32 model).

      When win32 came out, there was a lot of hand waving from developers over making the switch from win16. I'm sure MS had a compiler option to select int as 16, for ease of transition (e.g. less squawking)

      Yes, for better or worse, they went with the allowed-by-ANSI-C-but-still-annoyingly-different-from-UN*X's-LP64 LLP64 model.

      This makes me believe that the cstdint* cruft was done just to work around MS's intransigence (or IBM's 128 bit arch). As somebody else pointed out on another branch of the thread, it's another OOXML style hijacking of the committee (with particular regard to threading model).

      In fact, it would be truly sad if one had to include cstdint, just to get a base type of a given size. This would be so bad that I would prefer the disease to the cure.

      --
      Like a good neighbor, fsck is there ...
    9. Re:move on by Guy+Harris · · Score: 1

      No, they didn't. short int is a type the range of which is a possibly-improper subset of the range of int and int is a type the range of which is a possibly-improper subset of the range of long int. I.e., the ANSI C specification does not prevent an implementation of ANSI C from having short, int, and long int from all being 16, or all being 32, or all being 64. It also doesn't prevent a pointer from not fitting into any integral data type (C on the IBM i operating system has, I think, 128-bit pointers).

      The standard requires a ranking char<=short<=int<=long<=long long, so, yes, they could be all the same (but, short can not be larger than int, for example). But, any comp/arch that doesn't provide a base 8/16/32/64 is impractical.

      Inconvenient, but not completely impractical; presumably somebody uses C on the descendants of the Univac 1100 series in order for Unisys to continue to offer it. In practice, on architectures other than that and oddball stuff such as DSPs, you're going to get 8-bit, 16-bit, 32-bit, and 64-bit integral data types.

      Also, char is mandated to be 8 bits.

      No, it's mandated to be "large enough to store any member of the basic execution character set". (Yes, that's a direct quote from ISO/IEC 9899:1999 section 6.2.5 "Types".)

      So, to provide the size coverage and honor the ranking requirement, this pretty much locks in char==8,short==16,int==32.

      Except where it doesn't. Most programmers will probably not encounter cases where it doesn't, but they do exist.

      But, if you're going to cover a 64 bit number, which most programmers expect to be "long long",

      ...except for programmers using MSVC, where it's _I64 or something such as that.

      As to IBM's 128 bit address (which model specifically? some extension of S/390 or of their power* series?),

      The AS/400 and iSeries and System i and, now, Power Series. Those machines have a very high-level "virtual" instruction set that is never directly executed, and have two different "real" instruction sets, the older ones having a System/3x0-like CISC instruction set and the newer ones having a Power-architecture instruction set that has some extensions (for example, tag bits and, I think some fixed-point-decimal-arithmetic assists). The lowest level of the OS is compiled into the "real" instruction set, and it includes code that translates the high-level "MI" instruction set into whatever the "real" instruction set is so that programs compiled into the "MI" instruction set can be executed. That lowest level was written in, I think, a PL/I-like language for the older CISC machines, and rewritten in C++ for the newer Power-architecture machines; I suspect that in the C++ compiler used for that purpose pointers and long int are 64 bit. For the C++ compilers that generate the high-level instruction set, pointers are, as far as I know, 128-bit.

      they would need to have an integer type of the same size. If they've gone to the trouble of doing this, they have quite probably implemented an ALU that is just as wide.

      I don't think so. Note that

      1. not all of the bits in those pointers necessarily participate in address arithmetic;
      2. "MI" instructions that use those pointers probably translate into multiple "real" instructions.

        That is, you need to have something that can index through a byte array. If you can't, then the arch is some segmented variant

        Which I think it might be. I think MI pointers also contain other gunk, so it's not as if you can have objects of size 2^128 bytes.

    10. Re:move on by Guy+Harris · · Score: 1

      For the C++ compilers that generate the high-level instruction set, pointers are, as far as I know, 128-bit.

      According to The Fine Manual for the IBM i C++ compiler, you get two data models - P128 with 128-bit pointers, and LLP64 with 64-bit pointers (and, I'm guessing from what LLP64 usually means, 32-bit long int and 64-bit long long int).

    11. Re:move on by Guy+Harris · · Score: 1

      But intptr_t? Really? It takes more than a weird CPU to support pointers as specified in the C standard and yet be unable to store them into an integer type.

      How about a machine that uses tag bits to distinguish between pointers and non-pointer data and doesn't allow you to construct a pointer from raw bits?

    12. Re:move on by MikeBabcock · · Score: 1

      No offense, but 'sizeof' exists specifically to avoid problems. If you don't use it in your code and you assume things, you're causing your own problems.

      I've even used sizeof(char) in malloc because you never know.

      --
      - Michael T. Babcock (Yes, I blog)
    13. Re:move on by Forever+Wondering · · Score: 1

      No offense, but 'sizeof' exists specifically to avoid problems. If you don't use it in your code and you assume things, you're causing your own problems.

      I've even used sizeof(char) in malloc because you never know.

      None taken, but I'm hardly a newbie [sigh]. And, I do most of my work in kernel space with device drivers with hardware that isn't quite working yet. So, I assume nothing, but expect everything. BTW, I didn't invent the "long contains pointer" thing, I read it in a spec/standard somewhere. But, I've been doing C for 30+ years (and programming for 40+), and I can't remember what/when, but I do remember reading it. I guess I'll have to go on a trip down memory lane to find it, or dig through the basement ...

      I use sizeof liberally (e.g. sizeof(struct mystruct) * numelems). But, sizeof doesn't help because the granularity is on the order of bytes not bits. In the mythical/horrific 36 bit int case, chars are 6 bits. So, you'd still get a rounding up to 1. If, the oddball arch defines char to be 16 bits, you'd be in trouble because there's no coverage for 8 bits.

      Furthermore, since the spec defines a "char" as "single byte", and "byte" as being able to contain the "basic character set of the implementation". "Basic character set" appears to be defined as all the printable chars from ASCII (sans control chars). But, it also references UCS and 7-bit ASCII docs. The UCS is defined in terms of octets (and encompasses UTF-8 and variants). So, for purposes of size, I'll interpret "basic character set" as 8 bit ASCII as there is little-to-no advantage to using either odd bit sizes or sizes less than an octet (which is, by definition, 8 bits). So, I think that char being 8 bits is reasonably safe.

      However, in a config file for freetype, there is a comment about the conflict between some systems having char as 16 bits (e.g. TI C54x). But, it also says "ANSI C says that sizeof(char) is always 1". Other .h files hook CHAR_BIT and error out if it's not 8

      CHAR_BIT is also defined as "number of bits for smallest object that is not a bit-field (byte)". If that's not 8, your code will have to know a lot more about the environment (e.g. it will have to be intimately familiar with the fact that it's running in a DSP or FPGA, etc.) A simple sizeof(char) isn't going to help as many other things will need to be adjusted. You probably won't be using [or even have] malloc. My last embedded project was on an RISC inside an FPGA, controlling custom logic, and none of the vendor's libc stuff could be used because it would overflow the 128KB of internal static RAM that the program/data/stack had to fit into

      But, I cover the sizeof(char) not being what is expected by having a static assertion. As I mentioned elsewhere on the main thread, you can do it with a special switch/case combo [in a macro], so I have, in effect: COMPILE_TIME_ASSERT(sizeof_in_bits(char) == 8); If that were to fail [unlikely], I would determine the cause. If it turns out that an 8 bit number were defined by "__builtin_int8_t", I would adjust by doing (amongst other things) #define char __builtin_int8_t. What would need be done would be potentially more involved than, but that's the essence of it

      But, in rare circumstances, I'm not above hacking the compiler to get what I want (as I've done so, in the past). Or, generate the intermediate -S output and [automatically] modify that.

      What most people seem to be forgetting is that you need the 8/16/32 coverage so you can talk to the hardware on most systems (e.g. if you trying to write a 32 bit quantity to a 16 bit port, you'll get a bus lockup, or bad result).

      Beyond that, I prefer to use abstract typedefs (and I use a lot of them) that describe the function/semantics rather than the size. For example, suppose we had a system that involved peoples' ages. Instead of doing a "char age;" (or if you prefer "int8_t age;"), I would have

      --
      Like a good neighbor, fsck is there ...
  7. OMG ! by Anonymous Coward · · Score: 0

    blasphemy +

  8. So... by bytesex · · Score: 2

    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 ?

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
    1. Re:So... by Anonymous Coward · · Score: 0

      Grab the April 2011 Draft.

    2. Re:So... by Anonymous Coward · · Score: 0

      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.

    3. Re:So... by Old+Wolf · · Score: 4, Informative
    4. Re:So... by shentino · · Score: 1

      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?

    5. Re:So... by TheRaven64 · · Score: 4, Informative
      As with every other version of the C standard, you can read the draft yourself. 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).

      --
      I am TheRaven on Soylent News
    6. Re:So... by Anonymous Coward · · Score: 0

      Yes. Variable-length arrays have block scope, alloca returned memory blocks have function scope.

    7. Re:So... by Shinobi · · Score: 1

      If my very cursory reading of threads.h is correct, it's designed to provide better portability between platforms, without having to use a lot of POSIXisms, for example some embedded stuff that have no use for it, but can make use of threading.

    8. Re:So... by Anonymous Coward · · Score: 0

      Except it'll suck for embedded because it took its strengths from POSIX and its weaknesses from Windows. For example, you can't statically initialize mutexes. Which is super retarded. Thanks, Microsoft!

    9. Re:So... by David+Greene · · Score: 1

      _Generic() letting you write type-generic macros.

      Can anyone explain this design decision? It makes no sense to me. What they really want is function overloading. It reminds me of Fortran 2003 and its dumb, dumb, dumb implementation of polymorphism.

      --

    10. Re:So... by TheRaven64 · · Score: 1

      You can't have polymorphism in functions without name mangling (because functions are resolved by the linker, so if you have two functions called foo() then it will be confused, and you need them to be called _Z3fooi and _Z3foof - for example - to distinguish between different argument types). Requiring name mangling would break a lot of existing C code, since it would make taking the address of a function (for example) difficult and would mean that there is not a . Having _Generic for macros lets you do things like have a foo() macro that calls either foo() or foo_f() without needing to modify the ABI.

      --
      I am TheRaven on Soylent News
    11. Re:So... by David+Greene · · Score: 1

      Taking addresses of the function isn't a problem. It's easy to do in C++. What it would do is break the existing ABI, which is certainly a concern, but not a showstopper in my mind. You've got to recompile code to take advantage of it anyway.

      --

    12. Re:So... by slashdotjunker · · Score: 1

      _Generic, _Static_assert, and _Thread_local?!

      This is a joke, right?

      What fool polluted our beautiful language with capital letters?

    13. Re:So... by TheRaven64 · · Score: 1

      The C89 standard reserved identifiers starting with two underscores and ones starting with an underscore and a capital letter for future use and for the implementation. Compilers and libc implementations generally use double underscores for extensions and for semi-private identifiers in headers. The standard generally uses identifiers starting with an underscore and a capital letter for new keywords. Examples from C99 include _Bool and _Complex. C11 adds _Atomic, _Thread_local and _Noreturn. As with the C99 versions, there are headers that you can include that #define them as lower case identifiers without the leading underscore.

      --
      I am TheRaven on Soylent News
  9. Re:At least... by guus_deleeuw · · Score: 1, Troll

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

  10. Draft available for free by FrangoAssado · · Score: 5, Informative

    For those interested, the last draft before the official version is available for free here: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

  11. Re:At least... by 93+Escort+Wagon · · Score: 2

    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.

    --
    #DeleteChrome
  12. C90 * by tapspace · · Score: 2

    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.

  13. Re:C90 * by peppepz · · Score: 2

    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?

  14. Looks like story is already dated... by ibsteve2u · · Score: 4, Informative

    The standard is known unofficially as C1X

    GCC already says:

    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.

    --
    Orwell: "In a Time of Universal Deceit, telling the Truth is a Revolutionary Act"
    1. Re:Looks like story is already dated... by Anonymous Coward · · Score: 0

      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.

    2. Re:Looks like story is already dated... by forkazoo · · Score: 1

      And that fact that it was referred to as C1X during development is the reason that many people still recognize the name, and it is thus "known unofficially as C1X." The statements you quoted aren't in any sense mutually exclusive.

  15. C11 by Anonymous Coward · · Score: 0

    inb4 Spinal Tap joke

  16. Poul-Henning's take on this. by Anonymous Coward · · Score: 5, Informative

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

    1. Re:Poul-Henning's take on this. by Anonymous Coward · · Score: 1

      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.

    2. Re:Poul-Henning's take on this. by shutdown+-p+now · · Score: 4, Insightful

      His complaint about _Noreturn and similar keywords is silly. First, they were there 12 years ago already, in C99 - _Bool, _Complex etc. The reason for this scheme is that if they just made noreturn a keyword, existing valid C programs that use it as identifier would become illegal. On the other hand, underscore followed by capital letter was always reserved for implementations, so no conforming program can use it already. And then you can opt into more traditionally looking keywords, implemented via #define to the underscore versions, by explicitly including the appropriate header.

    3. Re:Poul-Henning's take on this. by Anonymous Coward · · Score: 0

      Any sources on this?

    4. Re:Poul-Henning's take on this. by bonch · · Score: 1

      This blog post is just too alarmist for me to take seriously. Most of the other entries on his site seems to also follow the same style--random outbursts, with irritating newlines after every sentence.

    5. Re:Poul-Henning's take on this. by Mr+Z · · Score: 1

      I agree. Oddly, there doesn't seem to be a _Restrict in C99, only restrict. Or did I miss it?

      Also, he appears to be confused about the roles of the leading underscore. He confuses the ABI convention and the source code convention. The ABI convention of prefixing symbols that have external linkage with an underscore is not specified by the C language, and many systems don't actually do that any more. My Linux box sure doesn't. The new ELF ABI for the DSP family I work with doesn't (but the older COFF ABI does). The source-level convention of reserving identifiers with a leading underscore (followed by a capital letter or another underscore) for the compiler goes back to C89. That's 22 years ago.

    6. Re:Poul-Henning's take on this. by Anonymous Coward · · Score: 0

      Legacy programs should be built with legacy compilers. If there is a name collision with some of the new keywords then a search/replace can fix it. If it's in the API for a widely used library then the pain will be a little worse but interface breakage is short term compared to the ugliness that all these _Underscores, _Case_inconsistency, and #includes will bring to the language for decades to come.

    7. Re:Poul-Henning's take on this. by master_p · · Score: 1

      Existing programs will still break if they include some relevant header. For example, if a program uses 'noretun' as a variable, then the variable's name will be _Noreturn if the relevant header is included, and thus it will not compile.

      It would be better if C adopted a form of namespaces; even a simple two-level namespace solution would do wonders.

    8. Re:Poul-Henning's take on this. by shutdown+-p+now · · Score: 1

      No, for some mysterious reason, "restrict" is the actual keyword. I don't know any specific reason for that. My suspicion is that they were practically certain that "bool" and "complex" would clash with a lot of existing code out there if made keyword, hence why they went for "_Bool" and "_Complex", but for "restrict" the potential for clashes was much smaller. And then the whole _Foo underscore convention was born, and was consistently used for all new keywords in C11, rather than selectively as it was in C99.

    9. Re:Poul-Henning's take on this. by shutdown+-p+now · · Score: 1

      Yes, but you don't have to include the header. If you want to compile the old file as-is, it'll still compile. If you want to add some new code to that old file, you can use the _Underscore form. And for new code, written from scratch for C99 or C11, you include the header and use regular form.

      Namespaces would be quite nice, but I don't see how they'd help in this particular case, since keywords are orthogonal to namespaces in pretty much all languages that have the latter (i.e. you can't use "if" as an identifier in either C++ or Java).

    10. Re:Poul-Henning's take on this. by master_p · · Score: 1

      But a header you need might include a header you don't want. Like including windows.h defines the macros min and max, for example.

    11. Re:Poul-Henning's take on this. by shutdown+-p+now · · Score: 1

      Not sure what you mean by this. Most certainly none of the standard C headers - including those that enable lowercase keywords - would include windows.h.

  17. Re:C90 * by Anonymous Coward · · Score: 0

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

  18. Torrent? by Anonymous Coward · · Score: 0

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

  19. Re:At least... by NickFortune · · Score: 1

    "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".

    --
    Don't let THEM immanentize the Eschaton!
  20. Re:At least... by sydneyfong · · Score: 1

    "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.

    --
    Don't quote me on this.
  21. Re:At least... by TheRaven64 · · Score: 1

    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.

    --
    I am TheRaven on Soylent News
  22. Re:C90 * by TheRaven64 · · Score: 1

    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.

    --
    I am TheRaven on Soylent News
  23. Re:C90 * by Anonymous Coward · · Score: 0

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

  24. Re:C90 * by petermgreen · · Score: 1

    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.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  25. Pesky space/time relavitity by Anonymous Coward · · Score: 0

    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.

    1. Re:Pesky space/time relavitity by barlevg · · Score: 1

      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.

    2. Re:Pesky space/time relavitity by 140Mandak262Jamuna · · Score: 2
      Two problems:

      The free sample in alpha centauri is in a filing cabinet in a dark basement guarded by leopards.

      Your time dilation assumes c towards Alpha Centauri, instant deceleration to 0, collect pdf and instant acceleration to c towards earth. Wont work.

      --
      sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    3. Re:Pesky space/time relavitity by barlevg · · Score: 1

      Your time dilation assumes c towards Alpha Centauri, instant deceleration to 0, collect pdf and instant acceleration to c towards earth. Wont work.

      Yes. THAT'S the problem with heading to Alpha Centauri. First of all, if we're imagining an interstellar ship capable of lightspeed travel, why not give it one of these? Second, fine--my starship accelerates at 1 gee (spaceship frame) for half the trip, then decelerates at 1 gee for the other half. To me, the trip takes two years each way. To my friends on Earth, I'm gone for about 10-20 years, if I remember this calculation correctly. Still I can get there and back in far less than fifty. The Vogons were *completely* reasonable.

      As for the leopards in the basement cabinet... well.

    4. Re:Pesky space/time relavitity by Christian+Smith · · Score: 2

      Your time dilation assumes c towards Alpha Centauri, instant deceleration to 0, collect pdf and instant acceleration to c towards earth. Wont work.

      Is that c 9x or c 1x? Must be 9x else you wouldn't be going to Alpha Centauri to get the new c spec.

    5. Re:Pesky space/time relavitity by Anonymous Coward · · Score: 0

      The time will still have been passing as usual at Centauri however. (during your travel there). So they could argue that you are late ,)

    6. Re:Pesky space/time relavitity by Anonymous Coward · · Score: 0

      lol this is why i read at -1 thx

  26. Re:At least... by epine · · Score: 1

    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.

  27. "Greater compatibility with C++ " by jcr · · Score: 0

    Is that supposed to be a feature?

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
    1. Re:"Greater compatibility with C++ " by shutdown+-p+now · · Score: 1

      It is, because it helps write libraries in C which remain usable from C++.

    2. Re:"Greater compatibility with C++ " by jcr · · Score: 1

      If C++ code can't call C code, that's a bug for C++ people to fix. All the competently designed languages deal with C just fine.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    3. Re:"Greater compatibility with C++ " by fnj · · Score: 2

      No, no, no. That's not the issue. C++ can automatically call any C code using 'extern "C"'. The issue is, how will C++ do *COMPILING* C source in C++ mode. C++ is not a true superset of C, so C is not a true subset of C++. Anything that makes them closer to being a super/sub set pair is a Good Thing.

    4. Re:"Greater compatibility with C++ " by Anonymous Coward · · Score: 0

      Just because you don't need this particular feature in the language doesn't mean that nobody else needs it and it certainly doesn't make it a non-feature.

      If C++ code can't call C code, that's a bug for C++ people to fix.

      It's a problem that causes headaches for C a lot of developers.

    5. Re:"Greater compatibility with C++ " by fnj · · Score: 1

      It's OK. C++ is the MOST able to call C of any language. Parent was confused.

    6. Re:"Greater compatibility with C++ " by Anonymous Coward · · Score: 0

      Exactly. If you want some other language to be compatible with C, make it compatible with C. But for the sake of humanity, don't force C++-isms on to programming languages that have no desire to be a vast morass of shit.

    7. Re:"Greater compatibility with C++ " by shutdown+-p+now · · Score: 1

      You can. The point in question is not ABI compatibility - it is there with extern "C". The point is to be able to directly use C header files without having to rewrite all declarations, as you have to do with most other languages (or use some tools that try to do it for you). Most C header files today are wrapped in #ifdef __cpluspus / extern "C" for just this reason. For the same reason, it makes sense to define new language facilities in a more or less compatible way, such as the newly added ability for explicit data alignment.

  28. Re:Can't we please let C die? by jcr · · Score: 4, Insightful

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

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  29. Re:At least... by Pirulo · · Score: 1

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

    As scrutiny grows, the chance of finding Microsoft having done something deserving a derogatory mention also approaches to 1

  30. Re:Can't we please let C die? by Anonymous Coward · · Score: 0

    No, no, it is you that should die.

  31. Re:Can't we please let C die? by jcr · · Score: 1

    Bring it on, tough guy.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  32. Lots of Irritating Superfluous (curly) Parentheses by tepples · · Score: 2

    Declaring variables at the beginning of their scope

    But do you really want to start a new scope every time you declare a variable? Then your code would be filled with so many }}}}}}}}} that it'd look like a curlier version of Lisp.

  33. The GCC project didn't try to patent IsNot by tepples · · Score: 1

    The whole situation is just the same as what people have complained about Microsoft for: Implementing non-standard stuff

    Not necessarily. The GCC project doesn't try to patent language extensions so that others can't implement the extension compatibly, such as using the name "IsNot" for a reference identity operator.

    1. Re:The GCC project didn't try to patent IsNot by Shinobi · · Score: 1

      Patenting is not the same thing as shoddy standards-compliance/developing and extending non-standard stuff.

      Also, I did point out Microsofts ruthless for-profit mentality AS OPPOSED to FSF's religious zealotry.

  34. Re:Can't we please let C die? by Anonymous Coward · · Score: 0

    Perhaps. I've never heard of this "C+++" you're talking about, so it's unlikely it added any real value to C++, which itself is one of the finest programming languages ever created.

    It may not always be beatiful, but there are so many simply ingenious ideas that it's nothing short of amazing how someone can come up with crap like Java or C# after C++.

  35. Static asserts have been around for a long time by tepples · · Score: 1

    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.

    There was already a macro for that, involving declaring an array whose size is 1 when true or -1 (and thus invalid in a way that produces a diagnostic) when false.

    1. Re:Static asserts have been around for a long time by Anonymous Coward · · Score: 0

      And? It was obviously a hack, and the diagnostic message was way off.

      (Arrays of size 0 are also invalid, and you don't have to declare such an array, only its type with typedef.)

    2. Re:Static asserts have been around for a long time by Forever+Wondering · · Score: 1

      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.

      There was already a macro for that, involving declaring an array whose size is 1 when true or -1 (and thus invalid in a way that produces a diagnostic) when false.

      I implemented such a macro using a switch statement that produced a "duplicate case" diagnostic if the assertion was false

      --
      Like a good neighbor, fsck is there ...
    3. Re:Static asserts have been around for a long time by tepples · · Score: 1

      and the diagnostic message was way off.

      No more than the diagnostic messages for anything related to the deeply nested templates that make up the C++ standard library. "basic_string? I'm using C++, not BASIC! And what the fsck is char_traits?"

      Arrays of size 0 are also invalid

      Presumably more compilers notice that arrays of negative size are invalid than notice that arrays of zero size are invalid, especially with interpretations of the flexible last field of a struct that were commonplace as implementation-specific extensions before C99 officially added them.

  36. Any 64-bit ints in C++? by tepples · · Score: 1

    I will once you show us a snippet of C++ code (in any version of the C++ standard) that uses 64-bit integers. In the real world, code written in C has to interoperate with code written in C++. Did make it into C++11?

    1. Re:Any 64-bit ints in C++? by Anonymous Coward · · Score: 1

      I will once you show us a snippet of C++ code (in any version of the C++ standard) that uses 64-bit integers.

      No you little shit-eater, either C90 can do it or it can't. Doesn't matter what C++ supports.

      Did <cstdint> make it into C++11?

      There's this great new website called "Google" that you might like to try.

    2. Re:Any 64-bit ints in C++? by fnj · · Score: 1

      OK, wise guy. The following works in either unextended C99 or unextended C++11. So now put up or shut up. Unextended C90. Can't be done. Never ask a question of a witness you don't know the answer to, and never challenge opposing counsel to prove something.

      #include
      #include
      int main(int argc, char *argv[])
      {
          int64_t a = 50000000000LL;
          int64_t b = 100000000000LL;
          int64_t c = 0;

          c = a + b;
          printf("%lld\n", c);
          return 0;
      }

      // Prints "150000000000"

    3. Re:Any 64-bit ints in C++? by fnj · · Score: 2

      Fucking markup. Here's a version you can read.

      #include <stdio.h>
      #include <stdint.h>
      int main(int argc, char *argv[])
      {
              int64_t a = 50000000000LL;
              int64_t b = 100000000000LL;
              int64_t c = 0;

              c = a + b;
              printf("%lld\n", c);
              return 0;
      }

      // Prints "150000000000"

    4. Re:Any 64-bit ints in C++? by tepples · · Score: 1

      either C90 can do it or it can't. Doesn't matter what C++ supports.

      Unless you plan to develop and market an entire operating environment that supports no language for applications other than C90, other languages' interoperability with C does matter.

      Did <cstdint> make it into C++11?

      There's this great new website called "Google" that you might like to try.

      The last time I tried to use Google to determine whether <cstdint> made it into C++11 was when I read the Slashdot story covering the announcement that C++11 had become a standard. At that time, none of the combinations of keywords that I tried turned up any reliable references stating either way that int64_t is in C++11 or if it remains only a widely implemented nonstandard extension. Which keywords should I have used instead?

    5. Re:Any 64-bit ints in C++? by tepples · · Score: 1

      There is no built-in 64-bit integer type in C90, but it's still possible in C90 using a software implementation of 64-bit integer arithmetic in terms of 32-bit integer arithmetic. I will shut up once I am certain that or has in fact become part of C++11. (See my reply to AC.)

    6. Re:Any 64-bit ints in C++? by fnj · · Score: 1

      I thought I made that clear with my source. The markup was screwed up in my first post, but you can see the includes in my followup. But really, this is all irrelevant to whether C90 supported 64 bit integers without relying on extensions or user code. Both <stdint.h> and <cstdint> are in the C++11 standard. BTW, FWIW, I believe there is still a weak point in all the C and C++ standards. To the best of my knowledge, the integer constant suffixes such as LL (and the %lld specifier in printf) parallel the "long long" data type, but "long long" is not guaranteed to be the same as int64_t. Heck, even L and %ld are only guaranteed to be "long" data type, not necessarily 32 bits. I'm not prepared to claim that I have perfectly absorbed all 1356 pages of the C++11 standard though.

      Anyway, from ISO/IEC 14882, Third Edition, 2011-09-01, Appendix D.5 C standard library headers:

      "For compatibility with the C standard library and the C Unicode TR, the C++ standard library provides the 25 C headers, as shown in Table 154.

      "Table 154 - C headers: ... ..."

    7. Re:Any 64-bit ints in C++? by Anonymous Coward · · Score: 0

      The inttypes.h header defines macros such as PRId64 which expands to the correct printf format specifier for int64_t in decimal. Of course something like printf("There are "PRId64" widgets\n", n); looks horrible, but at least there is a standard solution.

    8. Re:Any 64-bit ints in C++? by jps25 · · Score: 1

      From the C++11 standard:

      The contents of header <cinttypes> are the same as the Standard C Library header <inttypes.h>, with
      the following changes:
      - the header <cinttypes> includes the header <cstdint> instead of <stdint.h>, and
      - if and only if the type intmax_t designates an extended integer type (3.9.1), the following function
      signatures are added:
      intmax_t abs(intmax_t);
      imaxdiv_t div(intmax_t, intmax_t);
      which shall have the same semantics as the function signatures intmax_t imaxabs(intmax_t) and
      imaxdiv_t imaxdiv(intmax_t, intmax_t), respectively.

    9. Re:Any 64-bit ints in C++? by tepples · · Score: 1

      From the C++11 standard: [...] the header <cstdint>

      Thank you. Now I will stop whining.

    10. Re:Any 64-bit ints in C++? by Anonymous Coward · · Score: 0

      OK, wise guy. The following works in either unextended C99 or unextended C++11. So now put up or shut up. Unextended C90. Can't be done. Never ask a question of a witness you don't know the answer to, and never challenge opposing counsel to prove something.

      Correction: parent's code might work in a given C99 or C++11 implementation, if it has exactly 64-bit wide integers (because it is then required to define the types int64_t and uint64_t to represent them). However, it isn't required to compile on any conforming implementation. (If parent had used only type long long, he would have ensured at least 64-bit wide integer arithmetic.)

      In C90 "long" may be a 64-bit integer, and on 64 bit system it often is; however, it's not required to be. In a conforming implementation, you can check whether long is 64 bits by using the following snippet:

      typedef char static_assert_long_is_64_bits_wide[sizeof(long) * CHAR_BIT == 64];

    11. Re:Any 64-bit ints in C++? by fnj · · Score: 1

      Very good to know all the same; can't imagine how much reading I would have had to do to find that. You can actually put spaces around PRId64 without changing the printout if you think it looks more readable, but you do still need the % - e.g., "printf("There are %" PRId64 " widgets\n", n);"

      I'm still not finding anything to accomplish a parallel effect for integer constants, though.

    12. Re:Any 64-bit ints in C++? by fnj · · Score: 1

      Thanks; found it. Bummer. Is there ANYTHING that is not optional in C/C++? OK, that's rhetorical.

      Just to clarify, it's not that the implementation has an "int" that is 64 bits; it's that it has SOME integer type that is 64 bits: maybe int, maybe long, maybe long long. So an oddball machine that has a 36 bit word size or something may well not have int64_t. That case is so far off my radar I tend to ignore it. It certainly doesn't apply to any PC I can think of. Everything I, and probably 99.9% of readers of this story, come near is going to have it.

      But the following types ARE REQUIRED in a C99 compliant compiler: [u]int_least[8,16,32,64]_t. So if you use int_least64_t instead of int64_t in the example, then it has to compile and it has to work. You might get a 64 bit variable, you might possibly get 72 bits, conceivably you could get 91 bits or 10,013 bits, but it is going to be able to manipulate any 64 bit signed quantity, taking care with the sign extension.

    13. Re:Any 64-bit ints in C++? by Anonymous Coward · · Score: 0

      Correction: parent's code might work in a given C99 or C++11 implementation, if it has exactly 64-bit wide integers (because it is then required to define the types int64_t and uint64_t to represent them). However, it isn't required to compile on any conforming implementation.

      But if it doesn't have the type that the program requires then failing to compile is about all that one could expect. On the other hand, with C90 the compiler might have a 64-bit type available, but there's no portable way for a program to use it.

  37. WTF is "ISO C"? by Anonymous Coward · · Score: 3, Insightful

    I spent my early years programming K&R C on Unix systems.

    When the ANSI standards were ratified, ANSI took over.

    But WTF is "ISO C"? With a core language whose goal is portability and efficiency, why would I want the language trying to can platform-specific implementations like threading? C is not a general purpose language -- it's power comes from tying to the kernels and platform libraries of the industry at the lowest levels possible to maximize performance.

    If you don't need that maximum performance, you use C++ or another high-level language.

    ANSI C is the assembler of the modern computing age, not a general purpose programming language.

    Now get off my lawn!

    1. Re:WTF is "ISO C"? by tpotus · · Score: 1

      Never a mod point when you need one.

    2. Re:WTF is "ISO C"? by bonch · · Score: 1

      Without standards, code written on one platform wouldn't work on another, which was kind of the point of inventing programming languages in the first place, going back to that first cross-platform COBOL demonstration in late 1960.

      Shocked that I even have to explain this.

    3. Re:WTF is "ISO C"? by Forever+Wondering · · Score: 1

      Without standards, code written on one platform wouldn't work on another, which was kind of the point of inventing programming languages in the first place, going back to that first cross-platform COBOL demonstration in late 1960.

      Shocked that I even have to explain this.

      The original point was that, after K&R, ANSI was the standards body for C. Not that you don't need standards. Since I, too, starting by using K&R in 1981, and then ANSI, I, also, want to know "WTF is ISO C". Could be wrong, but I can't recall ANSI charging for the standard like ISO wants to [I've downloaded the draft, BTW].

      Shocked that you misread the original post.

      --
      Like a good neighbor, fsck is there ...
    4. Re:WTF is "ISO C"? by Anonymous Coward · · Score: 0

      "ISO C" typically refers to either the latest C standard as ratified by the International Organization for Standardization, ISO, or these days to the (already replaced) publication known as ISO/IEC 9899:1999 (also known as "C99").

      ANSI is an American standardization body, while ISO is an international one. ISO ratified the ANSI C89 standard in 1990 (known as "ISO C90"), and the roles were reversed with C99, which ANSI adopted as an ANSI standard in 2000. "ANSI C" still typically refers to the old standard that was produced back in 1989 but has since then been replaced by a newer version. Expect ANSI to adopt this standard, too, in a year or two.

      ANSI also charges for standard texts, although the fees are somewhat lower than those of ISO. However, most programmers need not have the final version, and are served just fine by the late drafts which are (legally) available for free on the Internet.

      I don't know if "standards body for C" is a well-defined term, but oftentimes (in a international context) a ratified ISO standard is considered to replace any "lesser" standard there might or might not exist.

    5. Re:WTF is "ISO C"? by Bill+of+Death · · Score: 1

      The standards bodies' names should answer your question. ANSI: A = American. ISO: I =International. An American standard isn't good enough for many people, no matter how open; they want an "International" standard with the associated level of bureaucracy.

    6. Re:WTF is "ISO C"? by krischik · · Score: 1

      An American standard isn't good enough for many people

      Not many. Most! 95% is most not mere many.

    7. Re:WTF is "ISO C"? by bregmata · · Score: 1

      "ISO C" is the name of the internationally-recognized standard C programming language. It replaced K&R C as the de facto and de jure standard development language on many computers decades ago.

      In the United States of America, a national standards body called the American National Standards Institute (ANSi), the local member of the International Standards Organization (ISO), ratified and adopted "ISO C" as the de jure standard. That's the way the ISO works: a standard is developed in cooperation with various international bodies, then each national standards body ratifies and proclaims it the local de jure standard. So, for those who are illiterate or ignorant enough to not understand how the tools they claim to use work, "ANSI C" is a local rebranding of "ISO C" for those parochial Americans who have an aversion to anything Forn.

      To claim ignorance of this is to proclaim your own ignorance. Hand in your geek credentials at the door and don't let it hit you on the way out.

    8. Re:WTF is "ISO C"? by Guy+Harris · · Score: 1

      "ISO C" is the name of the internationally-recognized standard C programming language.

      And there are three of them.

      I.e., from all you said, and from the fact that there have been 3 C standards from ISO (one originally from ANSI later adopted by ISO, one from ISO and adopted by ANSI, and one from ISO which will probably again be adopted by ANSI), if somebody wants to complain about stuff in the new C standard, saying "ANSI good, ISO bad" is not a valid way to do it.

    9. Re:WTF is "ISO C"? by Anonymous Coward · · Score: 0

      ANSI C was recalled when the American Standard Institute accepted the international version :-)
      And yes, it was ANSI C for the ones over the big pond (aka Atlantic)

  38. Fail-fast pointer types by tepples · · Score: 1

    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.

    The following is technically not portable, as it's possible for an implementation to choose types that make it fail. But at least it fails fast, using an idiom for a static assertion that works even on pre-C11 compilers:

    typedef long fake_intptr_t;
    extern const char sizeoflongequalssizeofvoidptr[(sizeof(fake_intptr_t) == sizeof(void *)) ? 1 : -1];

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

    Other than a major compiler publisher's tools not fully supporting any standard newer than C90, perhaps?

    1. Re:Fail-fast pointer types by Anonymous Coward · · Score: 0

      Clang defaults to C99

    2. Re:Fail-fast pointer types by tepples · · Score: 1

      Other than a major compiler publisher's tools not fully supporting any standard newer than C90, perhaps?

      I was referring to Microsoft Visual Studio.

      How easily does code compiled through Clang interoperate with code compiled through VC++?

  39. Re:Can't we please let C die? by mario_grgic · · Score: 2

    Not sure if you are being sarcastic or not, but you sum up the problem with C++ well. It's exactly because Bjarne has forced any idea he remotely heard about into C++ standard that C++ is a complete incoherent mess of a language it is today.

    --
    As the island of our knowledge grows, so does the shore of our ignorance.
  40. Re:At least... by swalve · · Score: 1

    Obligatory xkcd.

  41. Most critical software is written in COBOL by perpenso · · Score: 3

    Real mission critical stuff at Boeing? NASA? All that stuff then right?

    Actually their most critical software is probably written in COBOL, their payroll software. Without that COBOL based software nothing gets done. :-)

    1. Re:Most critical software is written in COBOL by shaitand · · Score: 1

      Nonsense! The NASA guys are purists and researchers these days with no interest in accomplishing anything save sacred and pure data collection. Surely they wouldn't want to stop their noble efforts over something like a paycheck!

  42. people still use C? by Anonymous Coward · · Score: 0

    just asking. I thought everyone nowadays use C#, Visual C++ Microsoft .net, Java, Python, PHP, Ruby, SQL, Assembly. But C? I haven't heard of anyone using C at my university.

    #include stdio.h

    int main()
    {
        printf( "Hello World!\n" );
        getchar();
        return 0;
    }

  43. Re:Can't we please let C die? by fnj · · Score: 1

    One man's incoherent mess is another man's versatility.

  44. Re:C90 * by Anonymous Coward · · Score: 0

    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.

    There is no situation where any of what you just said matters, EVER. If you wrote code in which it does, you shouldn't be allowed to write any code in C ever again, regardless of the standard you've chosen.

    I don't care what the size of your pointers are. It really pissed me off to find C code that wouldn't run correctly in 64-bit machines back when AMD first released x64 cpus. You shouldn't be doing pointer arithmetic without fucking checking the size of everything it matters, and you do have access to sizeof, so you shouldn't assume anything.

    The one exception is if you're writing highly optimized code that needs to have fantastic performance, but the first thing you're supposed to give up in that situation is portability because you're going to be tuning to that architecture anyway. I've wrote code in which moving to a cpu with less L1 cache would slow everything down considerably because I was counting on a minimum cache size to avoid misses. That thing was not meant to run anywhere else. Situations that need to have code hand optimized this much are rare, getting rarer, and should be avoided if at all possible anyway. So most of the time the C90 stuff is fine, and you just write portable and robust code.

    Not that I don't like C99, it has excellent features. However, there's definitely value is writing C90, plenty of embedded systems with compilers that don't understanding anything past that. And if you're writing C, 80% of you are writing for embedded systems.

  45. But... C Was Perfect... by Greyfox · · Score: 2

    Why mess with that? If you want more than that, you go with C++. Which isn't too bad as long as you avoid template metaprogramming like the plague...

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  46. My "Ask Slashdot" by jones_supa · · Score: 1

    You know, I've always been a fan of pure C, it being so clean, minimal and "the real deal". But I'm getting a bit tired of this fundamentalism and maybe want to extend my skillset. What language(s) would bring on a similarly nice and clean environment, and be worth learning, maybe even get me employed? Python, .NET, etc? Java and C++ feel so bloated... :S

    1. Re:My "Ask Slashdot" by bonch · · Score: 3, Funny

      Objective-C, of course.

  47. Re:Can't we please let C die? by Anonymous Coward · · Score: 0

    The irony of C++ is that Bjarne explicitly says that the type system was supposed to reduce typecasting, and yet every C++ application I've seen has typecasts all over the place. I rarely, if ever, typecast in C. I've even grepped source trees of comparably sized applications just to confirm my experience.

    C++ is an abomination. There will always be idiots writing a ton of crappy code in C and C++. However, at least with C you can spot bad code fairly quickly.

  48. Re:Let's get reading comprehension right first by b4dc0d3r · · Score: 1

    gp said nothing about C, the quote was "Microsoft seems to be content to let standard C wither and die." They release free versions of their compilers, and lots of open source projects provide Visual C solution files as their Windows option.

    When lots of code uses non-standard C, and is difficult if not annoying to port, Microsoft has you boxed in. And here's the thing. If you're on Windows, you want Microsoft's IDE and references and everything that comes with it, so Windows users tend to be comfortable with MSVC, personal anecdotes aside.

    I remember trying to compile eMule at home, and it required MSVC. I was shocked. An open source app requiring a proprietary tool? Well, when you have the desktop advantage and the primary audience will be computer users, meansing Windows users, why not just go with the OS maker's compiler? And all of its quirks, of course. The compiler is free, it's "native", and it has an effective monopoly for desktop app development. So what Microsoft decides is what you will see in a random code example.

  49. Multithreading by Anonymous Coward · · Score: 0

    Can someone recommend a good web reference for the new multithreading standard in C1X?

  50. Re:Lots of Irritating Superfluous (curly) Parenthe by mrchaotica · · Score: 1

    I've never had a problem with just declaring all my variables at the beginning of the procedure. Why do others consider that such a hard thing to do?

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  51. Re:Lots of Irritating Superfluous (curly) Parenthe by Anonymous Coward · · Score: 0

    Unless *all* your functions have less than 10 lines, it leaves variables with a too broad scope, and maybe uninitialized for too long. It also promotes variable reuse when you could create a new one (e.g. reusing the i variable as a loop index, when a narrower declaration would be better).

  52. Re:C90 * by Guy+Harris · · Score: 1

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

    There is also nothing in C90 that requires them, so if you're writing code that needs to run in ILP32 environments but needs to have 64-bit integers, you have to, as peppepz said, "write more platform specific code" - or rely on somebody else (e.g., GLib) to have done so for you (gint64 and guint64 being defined differently for most UN*X C compilers and for MSVC).

  53. Re:At least... by KZigurs · · Score: 1

    so?... Where is it?

  54. maybe you're older than you think by OrangeTide · · Score: 1

    I'm a bit confused by your comment. Your anecdote seems to confirm my statement rather than refute it.

    --
    “Common sense is not so common.” — Voltaire
  55. read the C standard sometime by Anonymous Coward · · Score: 0

    When K&R first came out, int's could be either 16 bit or 32 bit and long's were 32 always.

    except when longs were 36-bit. And already varied widely because people started running C on things other than a PDP-11.

    ANSI C changed this to short is 16, int is 32, and long is "large enough to contain a pointer".

    actually that's not true of C89 or C99 (I cannot comment on C1x as I don't want to spend the money on that spec).
    int cannot be smaller than an int, but it does not have to be 32. and the only type large enough to contain a pointer is intptr_t.

    The rest of your comment is moot as it is based on the premise above.

    1. Re:read the C standard sometime by Forever+Wondering · · Score: 1

      When K&R first came out, int's could be either 16 bit or 32 bit and long's were 32 always.

      except when longs were 36-bit. And already varied widely because people started running C on things other than a PDP-11.

      ANSI C changed this to short is 16, int is 32, and long is "large enough to contain a pointer".

      actually that's not true of C89 or C99 (I cannot comment on C1x as I don't want to spend the money on that spec). int cannot be smaller than an int, but it does not have to be 32. and the only type large enough to contain a pointer is intptr_t.

      The rest of your comment is moot as it is based on the premise above.

      I'm familiar with octal based arch's such as Sperry/Univac/Honeywell/whatever. The ones that had the oddball sizes died a slow painful death. The ones that survived and prospered were the ones that had word sizes that were 8/16/32/64. Devise a 36 bit arch these days and it will go nowhere. As to what most people used after a PDP/11, it was [no surprise] a Vax.

      My first C compiler was on a PDP/11 (Unix V7) and it got ported to 8086's and some m68k's (int's were 16 bit). But, some m68k's got their port from the Vax compiler, where int's were 32 bit. On the m68k's, the 32 bit compilers were a lot easier to deal with.

      If a short isn't 16 bits (which it has been on any compiler I've ever seen), what would the compiler intrinsic type be? Not some crufty int*_t typedef, but what the crufty typedef would typedef to (e.g. typedef short int16_t equivalent?)

      And speaking of crufty typedef's, before cstdint* there were caddr_t, ptrdiff_t, and uchar/byte, s16/u16, s32/u32, s64/u64. To my mind, no less clear and shorter (which is a benefit). For high usage types (e.g. int), everybody knows what you mean (e.g. you don't have to spell out "integer" as in Fortran/PL1)

      As a practical matter, forget the spec. On this point, it's just as inane as IETF specs that still insist on using "octet" instead of byte. The reason they did that was because of Sperry(?) et. al. which didn't have an 8 bit byte size. If you wish to disagree with that, when was the last time you told somebody you were downloading a 50 megaoctet file?

      If somebody wants to name the compiler and architecture that doesn't have int as 32 (that are still in use--as the 36 bit model had vacuum tubes and core memory, circa 1960 era, with some stragglers), I'd like to know about it as it would break 99.44% of existing C code. If a modern compiler/arch needs a 36 bit intrinsic type, it will not co-opt a current [well understood] type, it will create something like "__builtin_int36_t" and leave int alone. That's what intel does for its SIMD/Larabee extensions

      As to the floating 32/64 bit size of "long", it appears to be supported on gcc/clang/icc(?). AFAIK, the only 32/64 bit switchable compiler that chooses not to honor this is VC. So, what's the rationale for long's floating nature in these compilers, if the "long contains pointer" isn't true?

      --
      Like a good neighbor, fsck is there ...
    2. Re:read the C standard sometime by Anonymous Coward · · Score: 0

      If a short isn't 16 bits (which it has been on any compiler I've ever seen)

      C compilers for DSPs typically have char==short==int.

      also, C89 doesn't have intptr_t, it's a C99 and POSIX thing.

      As a practical matter, forget the spec.

      It's obvious you have.

    3. Re:read the C standard sometime by Guy+Harris · · Score: 1

      If a short isn't 16 bits (which it has been on any compiler I've ever seen), what would the compiler intrinsic type be? Not some crufty int*_t typedef, but what the crufty typedef would typedef to (e.g. typedef short int16_t equivalent?)

      Whatever the compiler writer decides to make it. No guarantee it's a type defined by C89 - or C99 (the spec just says the int N _t types are "signed integer types", not "standard signed integer types", so they could be "extended signed integer types").

      As a practical matter, forget the spec. On this point, it's just as inane as IETF specs that still insist on using "octet" instead of byte. The reason they did that was because of Sperry(?) et. al. which didn't have an 8 bit byte size.

      Sperry and Digital Equipment Corporation (PDP-10) and General Electric^W^WHoneywell (GE 645/Honeywell 6180).

      If somebody wants to name the compiler and architecture that doesn't have int as 32 (that are still in use--as the 36 bit model had vacuum tubes and core memory, circa 1960 era, with some stragglers), I'd like to know about it

      Presumably "vacuum tubes" is hyperbole, given that even the PDP-6 was transistorized. The only 36-bit architecture for which there are significant surviving implementations that I know of is the Univac 1100-and-descendants architecture, and Unisys does appear to claim to support C.

  56. Re:Let's get reading comprehension right first by Megane · · Score: 1

    They release free versions of their compilers

    ...which don't support C99 (and won't support C11)

    If you don't call "letting the standard wither", then I don't know what it is.

    (That being said, yeah, you can do most C99-ish things with MSVC by simply adding a "pp" to a few file names. Not that that's always convenient.)

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  57. If AMD was smart... by Anonymous Coward · · Score: 0

    they would aggressively assist GCC in getting code optimized properly for their chips. AMD has been going the open source route on their drivers. They should help make GCC even better.

    1. Re:If AMD was smart... by toddestan · · Score: 1

      You mean like this?

  58. Scala perhaps by Lazy+Jones · · Score: 1

    Have a look at this presentation ... Scala is very terse and expressive (= good, fun for programmers) and interoperates well with Java (= good for the boss and the business). It is modern, well-designed and has an active community.

    --
    "I love my job, but I hate talking to people like you" (Freddie Mercury)
  59. Re:Lots of Irritating Superfluous (curly) Parenthe by mrchaotica · · Score: 1

    [Declaring variables at the beginning of a function] leaves variables with a too broad scope...

    But wouldn't variables declared in the middle of the function still have function scope anyway?

    It also promotes variable reuse when you could create a new one (e.g. reusing the i variable as a loop index, when a narrower declaration would be better).

    A lack of loop scope is a separate issue.

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  60. Re:Can't we please let C die? by Anonymous Coward · · Score: 0

    You don't know Bjarne, do you... it's because he does the opposite of what you say that C++ is not three times its size.

  61. Re:Lots of Irritating Superfluous (curly) Parenthe by Haeleth · · Score: 1

    But wouldn't variables declared in the middle of the function still have function scope anyway?

    Not in the sense you appear to have in mind. This is C, not Javascript or Python. A variable declared halfway through the function has a scope half the size of one declared at the start, and cannot be accidentally read before it has been initialized.

  62. In an of itself by Anonymous Coward · · Score: 0

    Talk about the pot calling the...oh wait, this isn't the Wikipedia spelling article. Never mind...

  63. Re:Can't we please let C die? by master_p · · Score: 1

    If c++ dies, there would be no language that is so compatible with C that it can include its headers and also offer so high level features.

  64. It is for the Other 95% by krischik · · Score: 1

    (Ohh dear, yet another narrow-minded USA centric posting — but the, what to expect form /.)

    ISO (International Standards Organisation) is for the the other 95% of the human population for whom ANSI (American National Standards Institute) is of no concern.

    1. Re:It is for the Other 95% by msobkow · · Score: 1

      It has nothing to do with an "American Centric" viewpoint. ANSI was an established standard, it worked, and it worked well. I could care less whether ANSI or ISO certifies a standard provided that it's serving sane goals, and I don't see these "extensions" as sane.

      C was literally a very nice macro assembler for the PDP-11 instruction set, with the way the language handled pointers, addressing, and instructions like "++" mapped directly to opcodes, making for a very simpler compiler. It got more complex after those K&R beginnings, and ANSI tried to clean up the specifications to handle generic neuman architectures, not just PDP and VAX.

      "Making it more compatible with C++" is bullshit. C++ calls C, not the other way around. And if you need to expose C++ code to C invokers, it's a matter of using the appropriate C++ syntax to define the function signatures necessary. You don't need to change C to achieve that, because it's been done and working for over 20 years!

      This is another example of a bad "standard" coming out of biased committee on the wrong mission, not a US vs the world problem.

      --
      I do not fail; I succeed at finding out what does not work.
  65. There is a world outside the USA by krischik · · Score: 1

    ANSI was the standards body for C.

    Which was only valid standards body for 5% of the human population. That is why all important languages have ISO standards these days.

    1. Re:There is a world outside the USA by Forever+Wondering · · Score: 1

      ANSI was the standards body for C.

      Which was only valid standards body for 5% of the human population. That is why all important languages have ISO standards these days.

      I think you missed the point. I was well aware of what ISO was (I use ISO standards in other areas all the time). The "WTF is ISO C" was a subtle way of saying "the ISO C standard, just released, stinks". Too subtle for you, apparently.

      The ISO atomic/thread model is so poor and anemic that it makes pthreads look positively stellar (which is hard to do, BTW). Since ANSI isn't your thing, how about POSIX from the IEEE? Much of what ISO did is an incompatible encroachment on what POSIX already defined (and belongs in the libc standard, rather than adding bloat to the language core spec).

      --
      Like a good neighbor, fsck is there ...
  66. How do I secure boot Linux? by tepples · · Score: 1

    You mean "enough to encourage high school students to take up programming using non-Microsoft platforms"

    Not so fast. Microsoft has announced a plan to require PCs with preinstalled Windows 8 to have UEFI Secure Boot turned on by default, but PC makers aren't required to install any certificate other than Microsoft's or to provide a way for the owner of the PC to install a certificate. This will make it harder for an end user to install a non-Microsoft platform for dual booting without either A. installing Linux into a VirtualBox or B. somehow saving up $700* to replace a desktop PC with a Mac mini. B isn't likely with the child labor laws currently on the books.

    * Quoted price includes a Mac mini, a USB DVD recorder, and a display adapter to use the computer with the VGA monitor that a family is likely to already own.