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. General Programming
  3. C / C++ / MFC
  4. is there a tool which will automatically detect improper structure alignments.

is there a tool which will automatically detect improper structure alignments.

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 6 Posters 1 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.
  • U Offline
    U Offline
    User 4683260
    wrote on last edited by
    #1

    Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun

    P N A J 4 Replies Last reply
    0
    • U User 4683260

      Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun

      P Offline
      P Offline
      pix_programmer
      wrote on last edited by
      #2

      Member 4686590 wrote:

      Hello group.
      i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding.
       
      Thanks & Regards
      Prasun

      I think No. Which editor are you using to code your C program? I'm using Visual Studio 2008 IDE. In that I've to select the block I want to format(by pressing SHIFT+ARROWKEY or using mouse),and then press CTRL+F to format.

      C 1 Reply Last reply
      0
      • P pix_programmer

        Member 4686590 wrote:

        Hello group.
        i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding.
         
        Thanks & Regards
        Prasun

        I think No. Which editor are you using to code your C program? I'm using Visual Studio 2008 IDE. In that I've to select the block I want to format(by pressing SHIFT+ARROWKEY or using mouse),and then press CTRL+F to format.

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        He was not talking about indentation, but about this[^]

        Cédric Moonen Software developer
        Charting control [v3.0] OpenGL game tutorial in C++

        1 Reply Last reply
        0
        • U User 4683260

          Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun

          N Offline
          N Offline
          Niklas L
          wrote on last edited by
          #4

          I don't know, but Lint[^] comes to mind when dealing with static code analyses. Don't know if it can handle inefficient member alignment though. There is also a code analyzer in VS2010 if you have Ultimate edition. You might end up in trouble trying to optimize for space like this, if the order of the members is used in any way in the program. Some C (and C++) programmers tend to take shortcuts once in awhile. Just a word of warning.

          1 Reply Last reply
          0
          • U User 4683260

            Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #5

            Usually you can tell that something is not configured to pack correctly using #pragma pack(show) calls in suspect areas. http://msdn.microsoft.com/en-us/library/2e70t5y1%28v=VS.100%29.aspx[^]

            1 Reply Last reply
            0
            • U User 4683260

              Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #6

              What do you mean by "bad"?

              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