C Strings not returning from a function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harald van Dijk

    #46
    Re: C Strings not returning from a function

    Richard Heathfield wrote:
    Harald van Dijk said:
    >
    [I said]
    for compiling Translation Unit A. So it's hard to see how Translation
    Unit A's contents can be relevant to whether a diagnostic message is
    required when compiling Translation Unit B.
    That's why it's not a constraint violation, just plain undefined
    behaviour. No diagnostic required (but permitted as always).
    >
    I am delighted to announce that I have now completely lost the plot on this
    thread. You have managed to spin me around and around sufficiently often
    that I am quite dizzy, and I have no idea whether you are right or I am.
    >
    Fortunately for me, I don't particularly care (if you'll forgive me for
    saying so - I assure you it's nothing personal), since what we are
    discussing is code that we both agree is fundamentally broken, and our
    dispute is only concerned with how the compiler is required/allowed to
    react to it. Yes, academically it is interesting, and anyone who cares
    enough will no doubt take up the argument if they disagree sufficiently
    with you - but I have decided to adopt a position of "Just Don't Do That,
    and the issue disappears." :-)
    I have no problems with that. And regardless of whether a diagnostic is
    required, I can agree that an implementation /should/ generate one.

    Comment

    • Andrew Poelstra

      #47
      Re: Fixed version

      On Tue, 2006-26-09 at 14:58 +0000, Fred Kleinschmidt wrote:
      *(c++)
      What does this evaluate to? (Specifically, if the postfix operator is
      within parentheses, does it evaluate to the old value of c or the new
      one?)

      --
      Andrew Poelstra <http://www.wpsoftware. net/projects/>

      Comment

      • Thad Smith

        #48
        Re: Fixed version

        Andrew Poelstra wrote:
        On Tue, 2006-26-09 at 14:58 +0000, Fred Kleinschmidt wrote:
        >
        >>*(c++)
        >
        What does this evaluate to? (Specifically, if the postfix operator is
        within parentheses, does it evaluate to the old value of c or the new
        one?)
        The old one. The parentheses do not change the value.s

        --
        Thad

        Comment

        Working...