Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. *(char*)0 = 0;

*(char*)0 = 0;

Scheduled Pinned Locked Moved The Lounge
c++question
18 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 0 0x01AA

    *lol*, what is more important now? Understanding more or less crypted syntax of this and that language or understanding the business :doh: :laugh:

    Greg UtasG Offline
    Greg UtasG Offline
    Greg Utas
    wrote on last edited by
    #7

    To be fair, a lot of the talk is about what happens when that code (which tries to write 0 using a null pointer) is compiled and executed. The code looks like it was written by a C hacker, so how would it be written in modern C++? What will the compiler generate? How will the operating system react? How do virtual memory, memory protection, and caching work? All of this is technical but useful in certain situations. I agree that understanding one's domain and use cases is generally more important. I assume that's what you mean by "understanding the business". But don't get me started on motherelephanting pieces of elephant who run The Business™--one whose products require a lot of software development--but who couldn't care less about fostering a culture of software excellence, which means having people versed in this kind of arcane knowledge.

    Robust Services Core | Software Techniques for Lemmings | Articles
    The fox knows many things, but the hedgehog knows one big thing.

    <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
    <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

    J 1 Reply Last reply
    0
    • M megaadam

      Here is the most interesting entertaining C++ talk I've seen since Corona. It aint short, but was worth it for me. *(char*)0 = 0; - YouTube[^]

      "If we don't change direction, we'll end up where we're going"

      J Offline
      J Offline
      Jeremy Falcon
      wrote on last edited by
      #8

      What's the gist of the talk?

      Jeremy Falcon

      M 1 Reply Last reply
      0
      • 0 0x01AA

        *lol*, what is more important now? Understanding more or less crypted syntax of this and that language or understanding the business :doh: :laugh:

        J Offline
        J Offline
        Jeremy Falcon
        wrote on last edited by
        #9

        Both are... but specialized knowledge will become much, much less important as machines just do it themselves and companies look to save money. Most coders don't really learn squat anyway, so it's not like much will change in that regard. :laugh: This is just the short-term mind you. Pretty sure in 300 years from now AI will be so advanced no human will ever be able to figure it out anymore.

        Jeremy Falcon

        1 Reply Last reply
        0
        • Greg UtasG Greg Utas

          To be fair, a lot of the talk is about what happens when that code (which tries to write 0 using a null pointer) is compiled and executed. The code looks like it was written by a C hacker, so how would it be written in modern C++? What will the compiler generate? How will the operating system react? How do virtual memory, memory protection, and caching work? All of this is technical but useful in certain situations. I agree that understanding one's domain and use cases is generally more important. I assume that's what you mean by "understanding the business". But don't get me started on motherelephanting pieces of elephant who run The Business™--one whose products require a lot of software development--but who couldn't care less about fostering a culture of software excellence, which means having people versed in this kind of arcane knowledge.

          Robust Services Core | Software Techniques for Lemmings | Articles
          The fox knows many things, but the hedgehog knows one big thing.

          J Offline
          J Offline
          Jeremy Falcon
          wrote on last edited by
          #10

          Great point man. There's a case for both types of peeps. Although AI will definitely move the needle in regard to how much arcane knowledge is needed. To his point however, typically (and I'm generalizing) most of the super hardcore devs have serious social issues. Not that crappy devs don't too. But, what if the hardcore dev makes the wrong thing or doesn't think outside the box to see if it's even needed? Arcane or not it's just wasting time. Or what if he/she isn't a team player? So, while knowing what you're doing is super, duper important. I guess I'm just replying for the heck of it to say soft skills be important too. :laugh:

          Jeremy Falcon

          1 Reply Last reply
          0
          • M Maximilien

            Nice, I like intellectual mast**bation.

            CI/CD = Continuous Impediment/Continuous Despair

            J Offline
            J Offline
            Jeremy Falcon
            wrote on last edited by
            #11

            Ha ha ha. Truth bombs yo.

            Jeremy Falcon

            1 Reply Last reply
            0
            • Mike HankeyM Mike Hankey

              I guess YouTube has gone to all commercials...fuck em!

              I don't think before I open my mouth, I like to be as surprised a everyone else. PartsBin an Electronics Part Organizer - Release Version 1.3.0 JaxCoder.com Latest Article: SimpleWizardUpdate

              J Offline
              J Offline
              Jeremy Falcon
              wrote on last edited by
              #12

              We're not in a recession. Inflation is good for you. That's what the media tells us. What's worse is that the public will soon forget to and go back to believing what they see on TV.

              Jeremy Falcon

              Mike HankeyM 1 Reply Last reply
              0
              • J Jeremy Falcon

                What's the gist of the talk?

                Jeremy Falcon

                M Offline
                M Offline
                Maximilien
                wrote on last edited by
                #13

                How a single "obscure" line of code can lead to a rabbit's hole of a discussion It goes from the *(char*)0 = 0; to a modern C++ representation and how it can be executed on a near physical CPU Thrue memory mapping from Virtual Space to Physical Space and page tables walking. In the end, it's more like an interview question and see how a potential candidate can talk about this. And as the speaker says, it's more a question for people that will work really low level (compilers, hardware ... )

                CI/CD = Continuous Impediment/Continuous Despair

                J 1 Reply Last reply
                0
                • M Maximilien

                  How a single "obscure" line of code can lead to a rabbit's hole of a discussion It goes from the *(char*)0 = 0; to a modern C++ representation and how it can be executed on a near physical CPU Thrue memory mapping from Virtual Space to Physical Space and page tables walking. In the end, it's more like an interview question and see how a potential candidate can talk about this. And as the speaker says, it's more a question for people that will work really low level (compilers, hardware ... )

                  CI/CD = Continuous Impediment/Continuous Despair

                  J Offline
                  J Offline
                  Jeremy Falcon
                  wrote on last edited by
                  #14

                  Maximilien wrote:

                  Thrue memory mapping from Virtual Space to Physical Space and page tables walking.

                  Crap, now I have to watch the video because I'm not connecting the dots of how (char)0 = 0 turns into talking about protected memory, etc. Unless the title is trying to sound fancy and has nothing to do with that? :~

                  Jeremy Falcon

                  Greg UtasG 1 Reply Last reply
                  0
                  • J Jeremy Falcon

                    We're not in a recession. Inflation is good for you. That's what the media tells us. What's worse is that the public will soon forget to and go back to believing what they see on TV.

                    Jeremy Falcon

                    Mike HankeyM Offline
                    Mike HankeyM Offline
                    Mike Hankey
                    wrote on last edited by
                    #15

                    Pay no attention to the man behind the curtain. :) If you tell people something enough times they will eventually believe it. And as far as media there is no longer a source for real news, It's all either right or left and the news people just spit out what they're told.

                    I don't think before I open my mouth, I like to be as surprised a everyone else. PartsBin an Electronics Part Organizer - Release Version 1.3.0 JaxCoder.com Latest Article: SimpleWizardUpdate

                    1 Reply Last reply
                    0
                    • J Jeremy Falcon

                      Maximilien wrote:

                      Thrue memory mapping from Virtual Space to Physical Space and page tables walking.

                      Crap, now I have to watch the video because I'm not connecting the dots of how (char)0 = 0 turns into talking about protected memory, etc. Unless the title is trying to sound fancy and has nothing to do with that? :~

                      Jeremy Falcon

                      Greg UtasG Offline
                      Greg UtasG Offline
                      Greg Utas
                      wrote on last edited by
                      #16

                      Writing through a pointer whose address is out of bounds to your process, like a null pointer, results in a trap because of memory protection. SIGSEGV on *nix systems and 0xC0000005 on Windows.

                      Robust Services Core | Software Techniques for Lemmings | Articles
                      The fox knows many things, but the hedgehog knows one big thing.

                      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                      J 1 Reply Last reply
                      0
                      • Greg UtasG Greg Utas

                        Writing through a pointer whose address is out of bounds to your process, like a null pointer, results in a trap because of memory protection. SIGSEGV on *nix systems and 0xC0000005 on Windows.

                        Robust Services Core | Software Techniques for Lemmings | Articles
                        The fox knows many things, but the hedgehog knows one big thing.

                        J Offline
                        J Offline
                        Jeremy Falcon
                        wrote on last edited by
                        #17

                        That makes sense sure, just never seen anyone write to a null pointer. Then again, anything can happen I guess. :laugh:

                        Jeremy Falcon

                        Greg UtasG 1 Reply Last reply
                        0
                        • J Jeremy Falcon

                          That makes sense sure, just never seen anyone write to a null pointer. Then again, anything can happen I guess. :laugh:

                          Jeremy Falcon

                          Greg UtasG Offline
                          Greg UtasG Offline
                          Greg Utas
                          wrote on last edited by
                          #18

                          In the video, he mentions that maybe someone wanted to do it on purpose! And indeed, I have code that does it (actually using an invalid pointer, not a null one) to test the ability to recover, instead of aborting, when it happens.

                          Robust Services Core | Software Techniques for Lemmings | Articles
                          The fox knows many things, but the hedgehog knows one big thing.

                          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups