Announcement

Collapse
No announcement yet.

Linux 6.2 Looks To Enable "-funsigned-char" To Better Deal With Buggy Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Linux 6.2 Looks To Enable "-funsigned-char" To Better Deal With Buggy Code

    Phoronix: Linux 6.2 Looks To Enable "-funsigned-char" To Better Deal With Buggy Code

    Among the early pull requests sent out already ahead of the Linux 6.2 merge window opening next week is a change to enable "-funsigned-char" by default for Linux kernel builds. In preparation for this compiler flag change several fixes have already landed along with a lot of early testing, so any fallout is hoped to be minimal...

    https://www.phoronix.com/news/Linux-6.2-funsigned-char

  • #2
    I find it hideous that you have to write "signed char" or "unsigned char" just to say i8 or u8.

    Comment


    • #3
      The language says architecture dependent and this is how it should be. They are creating their own version of C which is not C. If someone wants explicit type there are already typedefs in the standard library for that.

      Comment


      • #4
        Originally posted by zoomblab View Post
        The language says architecture dependent and this is how it should be. They are creating their own version of C which is not C. If someone wants explicit type there are already typedefs in the standard library for that.
        How C an outlook. Next you'll be telling me that it's the coder's fault if they're too human to be able to write correct code in a memory-unsafe language.

        (For anyone who missed it, that's sarcasm. My main focus is UI/UX design and a pretty good argument can be made that the most ergonomic thing for writing correct code would be to fix char to one signedness and require something like native char for the current behaviour.)

        Comment


        • #5
          Is there a good case for why you'd want different hardware to handle this differently by default? Seems like it introduces more problems with hiding bugs behind different architectures.

          Comment


          • #6
            Originally posted by zoomblab View Post
            The language says architecture dependent and this is how it should be. They are creating their own version of C which is not C. If someone wants explicit type there are already typedefs in the standard library for that.
            So one driver per arch per device, sounds... Stupid. It's much better to just fix the assumption, something you are completely free to do. Also, kernels doesn't use the standard libraries.... It's... A kernel...

            Comment


            • #7
              Michael

              Typo

              "signeness"

              Comment


              • #8
                Like char is the only architecture dependent basic type in C...

                Comment


                • #9
                  Originally posted by zoomblab View Post
                  The language says architecture dependent and this is how it should be. They are creating their own version of C which is not C. If someone wants explicit type there are already typedefs in the standard library for that.
                  Damn. Next you're going to tell me they're planning on using a custom C dialect with its own language extensions! Madness!

                  https://docs.kernel.org/process/prog...-language.html

                  Comment


                  • #10
                    Originally posted by zoomblab View Post
                    The language says architecture dependent and this is how it should be. They are creating their own version of C which is not C. If someone wants explicit type there are already typedefs in the standard library for that.
                    Since signedness is implementation-dependent, it seems like either choice (GCC defaults or -funsigned-char) is consistent with the standard.

                    Comment

                    Working...
                    X