• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Pimps getting creative

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

    #21
    Originally posted by NickFitz View Post
    BTW, Suity is correct about the printf in the try function: GCC gives a warning that there are more placeholders than variables. Obviously, i should also be mentioned in that call
    Won't print 0 though, probably not anyway. It'll print whatever is lurking around the stack as an integer.
    Will work inside IR35. Or for food.

    Comment


      #22
      Originally posted by NickFitz View Post
      BTW, Suity is correct about the printf in the try function: GCC gives a warning that there are more placeholders than variables. Obviously, i should also be mentioned in that call
      In the very dim and distant past when I actually coded stuff, I seem to remember that printf will grab the last matching variable off the stack if not told otherwise. So printf(%d) would grab the last integer value from the stack, since that seems to be i as passed to try() then it uses that. Slopping coding but it works.

      Of course I could be entirely wonrg / out of date.
      "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

      Comment


        #23
        I'm also getting a warning at

        Code:
        index = strtol(argv[1], NULL, 10);
        "Implicit conversion loses integer precision: 'long' to 'int'"

        Maybe they're assuming a 32-bit system?

        Comment


          #24
          Originally posted by FatLazyContractor View Post


          Did you say that you are still on bench ?!!!
          I haven't sought to leave it yet

          Comment


            #25
            Originally posted by NickFitz View Post
            I'm also getting a warning at

            Code:
            index = strtol(argv[1], NULL, 10);
            "Implicit conversion loses integer precision: 'long' to 'int'"

            Maybe they're assuming a 32-bit system?
            gcc -m32 is targetting it for a 32 bit system isnt it?
            "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

            Comment


              #26
              It outputs the Steam Key for Samantha Fox Strip Poker, can I have my GCHQ code breaker job now please ?

              Comment


                #27
                Originally posted by DaveB View Post
                gcc -m32 is targetting it for a 32 bit system isnt it?
                Dunno ¯\_(ツ)_/¯

                I went from various assembly languages and Forth directly to JavaScript; I never did anything with C, so I only really know as much of it as I need to work in Objective C. Things like gcc command-line options are not within my ambit

                As I'm looking at it in Xcode, the warnings will be from clang, so maybe gcc wouldn't mind that bit.

                Comment


                  #28
                  Originally posted by VectraMan View Post
                  Eh? tbl is an array of function pointers that take one argument. So that's fine. I guess try is okay in C because it's a keyword in C++.

                  Is there more to it than 5?
                  I may have mentioned that tbl is an array of function pointers in the post before yours. Why not pop over and take a look?

                  My C coding days are long behind me, so don't judge too harshly.
                  Knock first as I might be balancing my chakras.

                  Comment


                    #29
                    Originally posted by suityou01 View Post
                    My C coding days are long behind me, so don't judge too harshly.
                    Progressed onto D now?
                    Brexit is having a wee in the middle of the room at a house party because nobody is talking to you, and then complaining about the smell.

                    Comment


                      #30
                      Originally posted by darmstadt View Post
                      Progressed onto D now?
                      Seesh harp.
                      Knock first as I might be balancing my chakras.

                      Comment

                      Working...
                      X