Skip to content
  • Home Home Home, current page.
  • Moments Moments Moments, current page.

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
RichFelker's profile
Rich Felker
Rich Felker
Rich Felker
@RichFelker

Tweets

Rich Felker

@RichFelker

Yeah, I do @musllibc, FOSS & infosec stuff. But now is not the time for a mostly-/only-tech Twitter feed.

musl-libc.org
Joined March 2014

Tweets

  • © 2018 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    1. Shayna Gentiluomo‏ @kd2luw May 3

      *shuts laptop forever*pic.twitter.com/3GS1JfNDSP

      154 replies 2,026 retweets 5,189 likes
      Show this thread
    2. Rich Felker‏ @RichFelker May 3
      Replying to @kd2luw @qrs

      Can we please make a law against == operators that do stupid things with mismatched types?

      6 replies 1 retweet 89 likes
      Rich Felker‏ @RichFelker May 3
      Replying to @RichFelker @kd2luw @qrs

      For fun, a C version: uint64_t a = -1; uint32_t b = -1; int c = -1; a==c; // true b==c; // true a==b; // false

      11:37 AM - 3 May 2018
      • 91 Retweets
      • 297 Likes
      • Paul Harvey Privacy Pro PLOW Rigoberto Molina Jonathan K Kwiskass - Sam olddellian Ricardo Mazeto Sharat M R Felix (@thegcat@kif.rocks)
      12 replies 91 retweets 297 likes
        1. New conversation
        2. beanieman‏ @cyanbeanie May 3
          Replying to @RichFelker @kd2luw @qrs

          Any good compiler should reject assigning a negative integer to an unsigned integer without an explicit cast.

          2 replies 0 retweets 2 likes
        3. Rich Felker‏ @RichFelker May 3
          Replying to @cyanbeanie @kd2luw @qrs

          The example is just as interesting without the conversions at assignment.

          1 reply 0 retweets 0 likes
        4. beanieman‏ @cyanbeanie May 3
          Replying to @RichFelker @kd2luw @qrs

          The C example is not very strange or bizarre - it is a result of sign extension. https://en.wikipedia.org/wiki/Sign_extension …

          1 reply 0 retweets 4 likes
        5. Rich Felker‏ @RichFelker May 3
          Replying to @cyanbeanie @kd2luw @qrs

          I think new languages should make promises that == is always false if the values are not actually equal (no lossy implicit conversions).

          1 reply 0 retweets 3 likes
        6. Eyal Lotem  🔥‏ @EyalL May 4
          Replying to @RichFelker @cyanbeanie and

          Signed/unsigned comparison errors would rule this out. (i.e: enable -Werror=sign-compare and every warning flag you can get your hands on)

          1 reply 0 retweets 3 likes
        7. Rich Felker‏ @RichFelker May 4
          Replying to @EyalL @cyanbeanie and

          Wouldn't rule out the floating point version though.

          2 replies 0 retweets 0 likes
        8. Rich Felker‏ @RichFelker May 4
          Replying to @RichFelker @EyalL and

          And would be painful to use. The right solution for new languages moving forward is defining == in terms of actual value equality, even when the types make it require more code to implement the comparison.

          1 reply 0 retweets 0 likes
        9. Eyal Lotem  🔥‏ @EyalL May 4
          Replying to @RichFelker @cyanbeanie and

          cost model suffers, for such a low level language. explicit expensiveness may be better.

          1 reply 0 retweets 0 likes
        10. 2 more replies
        1. New conversation
        2. Rich Felker‏ @RichFelker May 3
          Replying to @RichFelker @kd2luw @qrs

          For extra fun, do it with destructive "promotions" to float.

          1 reply 3 retweets 21 likes
        3. Rich Felker‏ @RichFelker May 4
          Replying to @RichFelker @kd2luw @qrs

          long a = 0x10000001; long b = 0x10000002; float c = 0x10000000; a==c; // true b==c; // true a==b; // false

          2 replies 16 retweets 76 likes
        4. 1 more reply
        1. New conversation
        2. Rodrigo Monteiro  👻‏ @amzeratul May 4
          Replying to @RichFelker @kd2luw @qrs

          Well, integer overflow is undefined behaviour in C, so you're not even guaranteed by the standard to get those results...

          1 reply 0 retweets 2 likes
        3. Rich Felker‏ @RichFelker May 4
          Replying to @amzeratul @kd2luw @qrs

          There is no overflow in the above.

          1 reply 0 retweets 3 likes
        4. Nicolas Désy‏ @liguorien May 4
          Replying to @RichFelker @amzeratul and

          A negative value is outside of uint range, so it is an overflow!

          2 replies 0 retweets 0 likes
        5. Rich Felker‏ @RichFelker May 4
          Replying to @liguorien @amzeratul and

          In C arithmetic (signed only), not assignment, is capable of overflow. Unsigned arithmetic is modular arithmetic.

          0 replies 0 retweets 2 likes
        6. End of conversation
        1. New conversation
        2. Antoine Giver of Etherium‏ @a_ferron May 4
          Replying to @RichFelker @kd2luw @qrs

          You have at least compiler warnings : initializes unsigned with signed numbers ⚠️

          1 reply 0 retweets 1 like
        3. Rich Felker‏ @RichFelker May 4
          Replying to @a_ferron @kd2luw @qrs

          You can edit the example not to have that; I just wrote it that way for brevity in a tweet.

          0 replies 0 retweets 1 like
        4. End of conversation
        1. Aidan Woods‏ @aidantwoods May 4
          Replying to @RichFelker @x0rz and

          Aidan Woods Retweeted Aidan Woods

          The true, true, false game is cool and all, but can you play it by repeating the same expression? :)https://twitter.com/aidantwoods/status/954430349907460097?s=21 …

          Aidan Woods added,

          Picture of terminal, text as follows:

php -a
Interactive shell

php > error_reporting(E_ERROR | E_WARNING);
php > $a; $b; $c = new stdClass;
php > var_dump($a ++== ($b ++==++ $c));
bool(true)
php > var_dump($a ++== ($b ++==++ $c));
bool(true)
php > var_dump($a ++== ($b ++==++ $c));
bool(false)
          Aidan Woods @aidantwoods
          🙃 pic.twitter.com/zpPHFRZW8h
          Show this thread
          0 replies 1 retweet 3 likes
          Thanks. Twitter will use this to make your timeline better. Undo
          Undo
        1. New conversation
        2. Joel Bernstein‏ @CastIrony May 3
          Replying to @RichFelker @kd2luw @qrs

          Wait, isn't assigning a negative literal to an unsigned integer undefined?

          1 reply 0 retweets 0 likes
        3. chuis pas goth (Tampon Locust)‏ @Jenesuispasgoth May 3
          Replying to @CastIrony @RichFelker and

          As far as I know converting signed to unsigned ints follows the (UINT_MAX - abs(negative_num)) op

          1 reply 0 retweets 1 like
        4. TQ (Dan Hirsch)‏ @thequux May 4
          Replying to @Jenesuispasgoth @CastIrony and

          That is *almost* correct; the standard defines it as repeatedly adding (UINT_MAX+1) until it fits. The only real difference in this case is the +1pic.twitter.com/XXrK4KenXn

          1 reply 0 retweets 4 likes
        5. chuis pas goth (Tampon Locust)‏ @Jenesuispasgoth May 4
          Replying to @thequux @CastIrony and

          Ah, yes, I did mean to write the +1, but there was some interference between my thoughts, my fingers, and the virtual keyboard. :-)

          0 replies 0 retweets 3 likes
        6. End of conversation

      Loading seems to be taking a while.

      Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

        Promoted Tweet

        false

        • © 2018 Twitter
        • About
        • Help Center
        • Terms
        • Privacy policy
        • Cookies
        • Ads info