[tkined] resend: warnings and a problem in tnmMapEvent:EvalBinding

From: Pete Flugstad (pete_flugstad@icon-labs.com)
Date: Sat Jul 21 2001 - 18:26:30 MET DST


[I sent this Friday 7/13, and I got no response, so I'm resending,
 am I getting kill-file'd somewhere? A "got it" would suffice...]

Okay, I am building scotty for win32 (host is Windows NT) and while
it's building, I'm going through and cleaning up some warnigs the
VC++ 6.0 compiler spit out. Here's the compiler banner:

  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86

I'm working with a snapshot from the scotty CVS tree from 7/13.

I used the binary installer from Scriptics to install Tcl 8.3.2
as D:\Tcl. I included the header files of course.

I've got a couple of warnings so far that I think need to be
addressed. First, it kept complaining about:

   .\..\tnm\generic\tnmInt.h(71) : warning C4273: 'stat' : inconsistent dll linkage.
                                   dllexport assumed.

This code is:

  EXTERN int
  TnmStat _ANSI_ARGS_((CONST char *path, struct stat *buf));

I believe this is related to the following #if, just above that:

  #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 8 && TCL_RELEASE_SERIAL > 2
  #define TnmStat TclStat
  #else
  #define TnmStat stat
  #endif

This #if fails, so TnmStat is #def'd to be "stat", which is
causing the warning above.

In looking through the Tcl header files, I find TclStat there, so
I'm guessing the #if should be:

  #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 3 && TCL_RELEASE_SERIAL >= 2

at the very least? (What version was TclStat introduced?)

It also complains about various other minor things: signed/unsigned comparisons,
passing NULL and various other things that are mostly innocuous. Is it worth
your while to send these as well?

But, it did spit out a error about:

  .\..\tnm\generic\tnmMapEvent.c(580) : warning C4700: local variable 'interp'
   used without having been initialized

Sure enough, I look there and:

    Tcl_Interp *interp;

    if (!eventPtr->mapPtr || !eventPtr->mapPtr->interp) {
        return TCL_OK;
    }

    Tcl_Preserve(interp);
    interp = eventPtr->mapPtr->interp;

This has to be a bug. The order of the last two lines
needs to be reversed.

If I see anything else that looks bad, I'll send it.

Pete

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Thu Jan 03 2002 - 14:56:27 MET