Re: Modifing existing header file

From: Sujan Datta (swdatta_at_hotmail.com)
Date: 10/15/03


Date: 15 Oct 2003 07:30:04 -0700

gordonb.xm6lu@sneaky.lerctr.org (Gordon Burditt) wrote in message news:<bmhvcg$213@library1.airnews.net>...
> >This header file is shared between multiple C files, which are
> >compiled into separate executables. However, these separate
> >executables run on the same machine and work in conjunction with each
> >other.
>
> What does "work in conjunction with each other" mean?
> Does this mean that copies of the struct are saved in disk
> files which are created/used by more than one of these programs?
>
  One of the executable is running all the time, some are running as
daemons in the background (do not know the exact number) and couple of
the executables are invoked by the daemons directly.(by system() call)
 None of the programs however write anything to a file thats is read
by another program.

> >Let say one of the C file is changed along with the header file, where
> >some defines and function prototypes were added in the middle of the
> >file as opposed to the end of the file.
>
> The ordering of defines and function prototypes usually doesn't
> matter, unless existing code uses the symbol being newly #define'd.
>
> On the other hand, changing a structure definition of a structure
> which is saved on disk may involve recompiling *ALL* programs
> that use that structure *AND* converting all existing data files
> containing that structure to the new format (including the backups,
> and the archives punched on cards and paper tape).
>
> >After compiling the
> >executable that uses the modified C file, what are the chances that
> >the new executable will cause problems when ran with the executables
> >compiled with older version of the h file.
>
> In ANSI C, you run one program at a time. What does "run with" mean?
> One program uses the other's output? In that case, it would depend
> a lot on what the output IS, wouldn't it? If your changes now
> allow the "sex" field to contain "Maybe" in addition to "Male",
> "Female", "Yes", and "No", anything dealing with that field may
> have to deal with the new possible value.
>
> >I guess the best way to go is to add them at the end of the h file.
>
> I see no reason why that would help the problem. For example,
> I see no reason why the line:
> #define if else
> wouldn't wreak exactly the same havoc whether you put it at
> the beginning or the end.
>
> >But I am wondering what kind changes in the middle of h will not cause
> >major headaches granted that the members in the struct are not
> >changed.
> >I realize that this is a very general question but the code is too big
> >for posting. Sorry for that. Thanks in advance to anyone who can
> >shed some light on this.
>
> You need to be a lot more specific.
  The extent of the changes are: Someone changed a C file that only
effects one of the executables. Also 2 or 3 defines were added in the
middle of the h file and couple of lines down 2 function prototypes
were added. Now I compiled all the programs with the new header. But
on the machine where all the programs are running ... I only replaced
the program that was effected by a change in the C file. I did not
replace all the older version of the programs with the newly compiled
version. So one of the newly compiled executables is running with the
older executables.
>
> >In the case that this is not the right place to post this question,
> >can somebody suggest a different group
>
> Gordon L. Burditt



Relevant Pages

  • Re: How safe is intellectual property in compiled binaries?
    ... > compiling source code into an executable is pre-defined. ... > a compiler destroys information in the compilation process, ... some names make their way into some executables as ...
    (comp.lang.fortran)
  • Re: Newbie advice on correct way to debug please
    ... >device immediately quits with no error messages. ... I tried compiling a debug ... answers are likely to be very different for eVC with MFC, ... The "executables" generated by VS.NET are ...
    (microsoft.public.pocketpc.developer)
  • compilation on different machines led to different executables
    ... After compiling the code on my machine I tried to run the executable. ... mistake in the code for special input values equal zero. ... why there are different executables when compiling it on different ... general explanation. ...
    (comp.lang.fortran)
  • Re: Class names are put into executables !!! ( Tenative Solution )
    ... >>Oliver, please stop telling me what is right or wrong for me. ... >>I don't like the class names in the executables. ... > 3rd party obfuscators available, you could run this over a copy of your ... > production source and then use that for compiling. ...
    (borland.public.delphi.non-technical)
  • Re: Can COM objects be called from both foxisapi and ASP?
    ... I did what you suggested and made 2 separate executables, ... I think that may be it is a problem with IIS accessing the ... foxisapi.dll and the com server executable within the one web site. ...
    (microsoft.public.fox.programmer.exchange)