Results 1 to 3 of 3

Thread: 2.0.1 - same variable used twice in expression

  1. #1

    Default 2.0.1 - same variable used twice in expression

    this patch fixes ambiguous assignment
    Attached Files Attached Files

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Heh, well spotted.

    It's one of those quirks in the C++ standard

    For reference:
    http://www.open-std.org/jtc1/sc22/wg...2008/n2798.pdf

    See 1.9.16 :

    Code:
    void f(int, int);
    void g(int i, int *v) {
    i = v[i++]; // the behavior is undefined
    i = 7, i++, i++; // i becomes 9
    i = i++ + 1; // the behavior is undefined
    i = i + 1; // the value of i is incremented
    f(i = -1, i = -1); // the behavior is undefined
    }
    And http://msdn.microsoft.com/en-us/libr...1c(VS.80).aspx
    Last edited by rombust; 04-30-2009 at 06:35 PM. Reason: Added reference

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Patch applied (to SVN)
    Many thanks

Similar Threads

  1. Variable support
    By in forum Other RTsoft Games
    Replies: 2
    Last Post: 10-19-2002, 11:50 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •