bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS Feature Branch - Windows Build Broken 4-Sep-2004


From: Mark D. Baushke
Subject: Re: CVS Feature Branch - Windows Build Broken 4-Sep-2004
Date: Sat, 04 Sep 2004 13:51:25 -0700

Conrad T. Pino <address@hidden> writes:

> The CVS.EXE build is broken on feature branch.  The Visual C++ 6.0 (VC6)
> compile output for EXE build follows in this message.  If anyone has a
> suggestion on what needs to be done I'll try to get it implemented.

A few simple patch suggestions follow my .signature. I have not tested
them, but compilation of cvs does complete on FreeBSD and GNU/Linux with
them.

> Best regards
> 
> Conrad Pino
> 
> --------------------Configuration: cvsnt - Win32 Debug--------------------
> Compiling...
> add.c
> admin.c
> annotate.c
> buffer.c
> H:\Conrad\Projects\cvs-1.12\src\buffer.c(2032) : warning C4013: 'fcntl' 
> undefined; assuming extern returning int
> H:\Conrad\Projects\cvs-1.12\src\buffer.c(2032) : error C2065: 'F_GETFL' : 
> undeclared identifier
> H:\Conrad\Projects\cvs-1.12\src\buffer.c(2037) : error C2065: 'O_NONBLOCK' : 
> undeclared identifier
> H:\Conrad\Projects\cvs-1.12\src\buffer.c(2041) : error C2065: 'F_SETFL' : 
> undeclared identifier

I don't know how the windows API handles controling stdio for blocking
versus non-blocking mode. However, all of the fcntl() calls should be
protected with HAVE_FCNTL macros and the buffer.c.

You might see what happens if you '#define TRUST_OS_FILE_CACHE 1'
in windows-NT/config.h

> checkin.c
> checkout.c
> classify.c
> client.c
> H:\Conrad\Projects\cvs-1.12\src\client.c(3359) : warning C4133: 'function' : 
> incompatible types - from 'struct sockaddr_in *' to
> 'const struct sockaddr *'

On some (all?) platforms sockaddr_in and sockaddr may be placed in union
with each other.

struct sockaddr_in {
        u_char  sin_len;
        u_char  sin_family;
        u_short sin_port;
        struct  in_addr sin_addr;
        char    sin_zero[8];
};

typedef u_char          sa_family_t;
typedef u_int32_t       in_addr_t;      /* base type for internet address */
struct in_addr {
        in_addr_t s_addr;
};
struct sockaddr {
        u_char          sa_len;         /* total length */
        sa_family_t     sa_family;      /* address family */
        char            sa_data[14];    /* actually longer; address value */
};


So, it is possible that to clean up this warning, a cast or a union
should be used.

> commit.c
> create_adm.c
> cvsrc.c
> diff.c
> edit.c
> entries.c
> error.c
> exithandle.c
> H:\Conrad\Projects\cvs-1.12\src\exithandle.c(47) : warning C4028: formal 
> parameter 1 different from declaration
> H:\Conrad\Projects\cvs-1.12\src\exithandle.c(47) : warning C4024: 
> 'signals_register' : different types for formal and actual
> parameter 1

My FreeBSD compiler also has this warning. The right way to do it is to
ensure that there are two forms of cleanup, one for the signal handlers
and one for atexit. This would make the OpenBSD folks happy as more than
one has complained that we really need to do things correctly to allow
for things like "StackGuard" and/or ProPolice to work properly. Having
separate stub functions would not be that difficult to do if you have
the energy.

> expand_path.c
> fileattr.c
> filesubr.c
> find_names.c
> hash.c
> history.c
> ignore.c
> import.c
> H:\Conrad\Projects\cvs-1.12\src\import.c(1627) : warning C4018: '!=' : 
> signed/unsigned mismatch
> lock.c
> log-buffer.c
> H:\Conrad\Projects\cvs-1.12\src\log-buffer.c(174) : warning C4552: '!=' : 
> operator has no effect; expected operator with side-effect

Derek will need to comment, but it appears to me that the second and third
clauses of the for loop:

        for (data = buf->data; data = data->next; data != NULL)

are reversed...


> H:\Conrad\Projects\cvs-1.12\src\log-buffer.c(193) : warning C4018: '!=' : 
> signed/unsigned mismatch

A cast to size_t should fix this warning.

> H:\Conrad\Projects\cvs-1.12\src\log-buffer.c(194) : error C2065: 
> 'fatal_errors' : undeclared identifier

It appears that fatal_errors is only available when PROXY_SUPPORT is
defined. The following might fix things for you.

                        error (
#ifdef PROXY_SUPPORT
                               fatal_errors,
#else
                               false,
#endif
                               errno, "writing to log file");

> H:\Conrad\Projects\cvs-1.12\src\log-buffer.c(245) : warning C4018: '!=' : 
> signed/unsigned mismatch

                if (fwrite (data, 1, *got, lb->log) != *got)

I suppose this may be written as 

                if (fwrite (data, 1, *got, lb->log) != (size_t) *got)

> H:\Conrad\Projects\cvs-1.12\src\log-buffer.c(302) : warning C4018: '!=' : 
> signed/unsigned mismatch

                if (fwrite (data, 1, *wrote, lb->log) != *wrote)
may be written as 
                if (fwrite (data, 1, *wrote, lb->log) != (size_t) *wrote)

> log.c
> login.c
> logmsg.c
> ls.c
> H:\Conrad\Projects\cvs-1.12\src\ls.c(333) : warning C4101: 'buf' : 
> unreferenced local variable
> main.c
> H:\Conrad\Projects\cvs-1.12\src\main.c(1255) : warning C4013: 'nstrftime' 
> undefined; assuming extern returning int
> mkdir.c
> mkmodules.c
> modules.c
> myndbm.c
> ndir.c
> no_diff.c
> parseinfo.c
> H:\Conrad\Projects\cvs-1.12\src\parseinfo.c(453) : error C2065: 
> 'PrimaryServer' : undeclared identifier

That code needs to be protected by a #ifdef PROXY_SUPPORT.

> H:\Conrad\Projects\cvs-1.12\src\parseinfo.c(453) : warning C4047: '=' : 'int 
> ' differs in levels of indirection from 'struct
> cvsroot_s *'
> H:\Conrad\Projects\cvs-1.12\src\parseinfo.c(454) : error C2223: left of 
> '->method' must point to struct/union
> H:\Conrad\Projects\cvs-1.12\src\parseinfo.c(455) : error C2223: left of 
> '->method' must point to struct/union
> patch.c
> pwd.c
> rcmd.c
> rcs.c
> H:\Conrad\Projects\cvs-1.12\src\rcs.c(1573) : warning C4018: '>' : 
> signed/unsigned mismatch

I have not looked at the right way to remove that warning...

> rcscmds.c
> recurse.c
> release.c
> remove.c
> repos.c
> root.c
> rsh-client.c
> run.c
> scramble.c
> server.c
> sockerror.c
> socket-client.c
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(91) : warning C4047: 
> 'function' : 'unsigned int ' differs in levels of indirection
> from 'int (__cdecl *)(void *,char *,int ,int ,int *)'
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(91) : warning C4024: 
> 'buf_initialize' : different types for formal and actual
> parameter 1
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(92) : warning C4047: 
> 'function' : 'unsigned int ' differs in levels of indirection
> from 'int (__cdecl *)(void *,const char *,int ,int *)'
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(92) : warning C4024: 
> 'buf_initialize' : different types for formal and actual
> parameter 2
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(93) : warning C4113: 'int 
> (__cdecl *)(void *)' differs in parameter lists from 'int
> (__cdecl *)(void *,char *,int ,int ,int *)'
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(96) : warning C4113: 'void 
> (__cdecl *)(struct buffer *)' differs in parameter lists
> from 'int (__cdecl *)(void *,int )'
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(96) : warning C4133: 
> 'function' : incompatible types - from 'void (__cdecl *)(struct
> buffer *)' to 'int (__cdecl *)(void *,int )'
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(97) : warning C4047: 
> 'function' : 'int (__cdecl *)(void *)' differs in levels of
> indirection from 'struct socket_buffer *'
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(97) : warning C4024: 
> 'buf_initialize' : different types for formal and actual
> parameter 7
> H:\Conrad\Projects\cvs-1.12\src\socket-client.c(97) : error C2198: 
> 'buf_initialize' : too few actual parameters

Hmmm... this is bad. Derek probably needs to lend a hand.

> stack.c
> startserver.c
> status.c
> subr.c
> H:\Conrad\Projects\cvs-1.12\src\subr.c(212) : warning C4101: 'lastfield' : 
> unreferenced local variable
> tag.c
> H:\Conrad\Projects\cvs-1.12\src\subr.c(1721) : warning C4761: integral size 
> mismatch in argument; conversion supplied
> update.c
> vers_ts.c
> H:\Conrad\Projects\cvs-1.12\src\vers_ts.c(411) : warning C4101: 'sb' : 
> unreferenced local variable

Easily removed.

> version.c
> waitpid.c
> watch.c
> woe32.c
> wrapper.c
> zlib.c
> Error executing cl.exe.
> 
> cvs.exe - 8 error(s), 132 warning(s)

Index: src/ChangeLog
===================================================================
RCS file: /cvs/ccvs/src/ChangeLog,v
retrieving revision 1.2872
diff -u -p -r1.2872 ChangeLog
--- src/ChangeLog       3 Sep 2004 23:33:35 -0000       1.2872
+++ src/ChangeLog       4 Sep 2004 20:49:24 -0000
@@ -1,3 +1,16 @@
+2004-09-04  Mark D. Baushke  <address@hidden>
+
+       * import.c (expand_at_signs): Typecasting for fwrite results.
+       * log-buffer.c (log_buffer_input, log_buffer_output,
+       log_buffer_initialize): Ditto.
+
+       * log-buffer.c (log_buffer_initialize): Protect reference to
+       fatal_errors.
+
+       * ls.c (ls_fileproc): Remove unused variables.
+       * subr.c (increment_revnum): Ditto.
+       * vers_ts.c (time_stamp): Ditto.
+
 2004-09-03  Derek Price  <address@hidden>
 
        * rcs.c (RCS_checkin), commit.c (remove_file): Accept UPDATE_DIR
Index: src/import.c
===================================================================
RCS file: /cvs/ccvs/src/import.c,v
retrieving revision 1.150
diff -u -p -r1.150 import.c
--- src/import.c        3 Sep 2004 23:33:35 -0000       1.150
+++ src/import.c        4 Sep 2004 20:49:24 -0000
@@ -1624,7 +1624,7 @@ expand_at_signs (const char *buf, off_t 
        size -= len;
     }
 
-    if (fwrite (cp, 1, size, fp) != size)
+    if (fwrite (cp, 1, size, fp) != (size_t) size)
        return EOF;
 
     return 1;
Index: src/log-buffer.c
===================================================================
RCS file: /cvs/ccvs/src/log-buffer.c,v
retrieving revision 1.11
diff -u -p -r1.11 log-buffer.c
--- src/log-buffer.c    2 Sep 2004 20:39:47 -0000       1.11
+++ src/log-buffer.c    4 Sep 2004 20:49:24 -0000
@@ -190,8 +190,14 @@ log_buffer_initialize (struct buffer *bu
                {
 #endif /* PROXY_SUPPORT */
                    if (fwrite (data->bufp, 1, data->size, lb->log)
-                       != data->size)
-                       error (fatal_errors, errno, "writing to log file");
+                       != (size_t) data->size)
+                       error (
+#ifdef PROXY_SUPPORT
+                              fatal_errors,
+#else /* !PROXY_SUPPORT */
+                               false,
+#endif /* PROXY_SUPPORT */
+                              errno, "writing to log file");
                    fflush (lb->log);
 #ifdef PROXY_SUPPORT
                }
@@ -242,7 +248,7 @@ log_buffer_input (void *closure, char *d
            if (lb->log)
            {
 #endif /* PROXY_SUPPORT */
-               if (fwrite (data, 1, *got, lb->log) != *got)
+               if (fwrite (data, 1, *got, lb->log) != (size_t) *got)
                    error (
 #ifdef PROXY_SUPPORT
                           lb->fatal_errors,
@@ -299,7 +305,7 @@ log_buffer_output (void *closure, const 
            if (lb->log)
            {
 #endif /* PROXY_SUPPORT */
-               if (fwrite (data, 1, *wrote, lb->log) != *wrote)
+               if (fwrite (data, 1, *wrote, lb->log) != (size_t) *wrote)
                    error (
 #ifdef PROXY_SUPPORT
                           lb->fatal_errors,
Index: src/ls.c
===================================================================
RCS file: /cvs/ccvs/src/ls.c,v
retrieving revision 1.13
diff -u -p -r1.13 ls.c
--- src/ls.c    20 Aug 2004 21:02:31 -0000      1.13
+++ src/ls.c    4 Sep 2004 20:49:24 -0000
@@ -330,7 +330,6 @@ ls_fileproc (void *callerdat, struct fil
 {
     Vers_TS *vers;
     char *regex_err;
-    void *buf;
     size_t length;
     Node *p, *n;
     bool isdead;
Index: src/parseinfo.c
===================================================================
RCS file: /cvs/ccvs/src/parseinfo.c,v
retrieving revision 1.55
diff -u -p -r1.55 parseinfo.c
--- src/parseinfo.c     2 Sep 2004 20:39:47 -0000       1.55
+++ src/parseinfo.c     4 Sep 2004 20:49:24 -0000
@@ -448,6 +448,7 @@ warning: this CVS does not support Prese
                goto error_return;
            }
        }
+#ifdef PROXY_SUPPORT
        else if (strcmp (line, "PrimaryServer") == 0)
        {
            PrimaryServer = parse_cvsroot (p);
@@ -460,6 +461,7 @@ warning: this CVS does not support Prese
 "Only PrimaryServers with :ext: methods are valid, not `%s'.",
                       p);
        }
+#endif /* PROXY_SUPPORT */
 #if defined PROXY_SUPPORT && ! defined TRUST_OS_FILE_CACHE
        else if (strcmp (line, "MaxProxyBufferSize") == 0)
        {
Index: src/subr.c
===================================================================
RCS file: /cvs/ccvs/src/subr.c,v
retrieving revision 1.118
diff -u -p -r1.118 subr.c
--- src/subr.c  31 Aug 2004 20:02:20 -0000      1.118
+++ src/subr.c  4 Sep 2004 20:49:24 -0000
@@ -209,7 +209,6 @@ char *
 increment_revnum (const char *rev)
 {
     char *newrev, *p;
-    int lastfield;
     size_t len = strlen (rev);
 
     newrev = xmalloc (len + 2);
Index: src/vers_ts.c
===================================================================
RCS file: /cvs/ccvs/src/vers_ts.c,v
retrieving revision 1.57
diff -u -p -r1.57 vers_ts.c
--- src/vers_ts.c       2 Jul 2004 15:36:29 -0000       1.57
+++ src/vers_ts.c       4 Sep 2004 20:49:25 -0000
@@ -408,7 +408,6 @@ unix_time_stamp (const char *file)
 char *
 time_stamp (const char *file)
 {
-    struct stat sb;
     time_t mtime = unix_time_stamp (file);
     return mtime ? entries_time (mtime) : NULL;
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]