This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FileRunner under cygwin - simple compilation - Success.

Igor Pechtchanski <pechtcha <at>> writes:
> Arg #3 is a pointer to a function (Tcl_CmdProc).  See where that's
> declared *in the preprocessed file* (so that all macros are expanded) and
> see if your declarations of GetTimeFromSecs, etc, correspond to it.  The
> most obvious mismatch is probably the "const char* argv[]" vs. your "char*
> argv[]".

OK, this is the definition of Tcl_CmdProc in the preprocessed file:
typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp,
  int argc, const char *argv[]);

And here is GetTimeFromSecs also from the preprocessed file:
static int GetTimeFromSecs(ClientData clientData, Tcl_Interp* interp,
                           int argc, char* argv[]);

... so I changed "char* argv[]" to to "const char *argv[]" at
the affected spots in the source code in ext.c.

It now compiles and links without warnings and the application
(FileRunner) works with the resulting .dll. I can't be certain
yet if it also fixed the problem I was having, since it was

I can see how this change makes the data types agree and gets
rid of the warnings.

But I am quite baffled as to why this should be declared as a
constant !? That argument  seems to be a pointer to an array
of input arguments to a function. Surely such a pointer would
have to change dynamically during execution and no way could
it be constant !?

Oh well. These comments sort of give away my level of
(in)experience I suppose... :o)

Another thing is that, seeing what it was all about, I can't
imagine that the warnings actually mattered, or made the
resulting .dll work differently in any way (?)

Can't be sure if I'm through with this yet but your advice saw
me through a couple of initial hurdles in style here.

Big THANKS, again, for your excellent help !

Cheers CV

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]