how to deal with DataModel changes...

This is a discussion on how to deal with DataModel changes... within the C Programming forums, part of the General Programming Boards category; Hi all, For an existing code written with data-model LP32, what could be the best way to deal with the ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    39

    Question how to deal with DataModel changes...

    Hi all,

    For an existing code written with data-model LP32, what could be the best way to deal with the change of the Data-Model from LP32 to ILP32.

    In data-model LP32: long and pointer are 32 bits, int and short are 16 bits. While in ILP32: int, long and pointer size is 32 bits.

    What could be the problems that may arise when an LP32 based application code is ported to an ILP32 based system.

    I think the only impact would be because of the int size changing from 16 to 32 bits. So, all the external touch points of the application may potentially get affected e.g. File access, IPCs, DataBase access, external library access....

    In order to deal with this:
    Use a script to convert all int declarations to short. This would retain the intended bit size of variables. But how effective would it be while dealing with external library references??? Some library functions expecting an int on a LP32 based system expected only 16 bits but on ILP32 they would expect 32 bits. What other problems could be there in this approach?

    Is compile-and-see-what-happens only strategy for this??? Any thoughts in this area would be very helpful.


    TIA.

    - Ruchikar
    <Signature
    name="Ruchikar"
    quote="discussions are forgotten, only code remains"/>

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>Use a script to convert all int declarations to short. This would retain the intended bit size of variables.
    Not necessarily. In terms of the C standard, a short is not guaranteed to be 16 bits, so you need to validate this with your compiler first.

    >>Is compile-and-see-what-happens only strategy for this???
    That, and lots of detailed testing. You can of course review the data that is passed to/from external sources (files, IPC etc) whilst the app is in working order, then view again when your changes are done. Sounds a bit of a tedious problem though, good luck There may be other ways, but I don't know.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Deal or No Deal listbox prob
    By kryptkat in forum Windows Programming
    Replies: 5
    Last Post: 03-30-2009, 07:53 PM
  2. pls fix my deal or no deal program
    By llinocoe in forum C Programming
    Replies: 5
    Last Post: 09-23-2008, 12:37 PM
  3. pls healp deal or no deal
    By llinocoe in forum C Programming
    Replies: 2
    Last Post: 09-19-2008, 01:23 PM
  4. Card shuffle and deal want to put on Stack
    By sugie in forum C++ Programming
    Replies: 4
    Last Post: 12-12-2005, 08:40 PM
  5. whats the deal with EOF really ???
    By gemini_shooter in forum C Programming
    Replies: 7
    Last Post: 03-06-2005, 04:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21