Mail Archives: cygwin/2005/01/19/13:13:56
Igor Pechtchanski <pechtcha <at> cs.nyu.edu> 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
intermittent.
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: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -