windows compilation problem

FELLIN, JEFFREY K (JEFF) jkf at research.att.com
Fri Jun 24 08:29:36 MDT 2011


I'm compiling rsync 3.0.9pre1 using Microsoft Visual Studio 2010 on my windows XP system. I get a compilation failure in flist.c, function send_directory:

flist.c(1653) : error C2143: syntax error : missing ';' before 'type'
flist.c(1654) : error C2065: 'name_len' : undeclared identifier
flist.c(1654) : warning C4018: '>=' : signed/unsigned mismatch
flist.c(1660) : error C2065: 'name_len' : undeclared identifier

I realize the construct at this line is valid C99 syntax, which isn't accepted by MS.

Can the code be changed to declare this variable at the beginning of the block?

From:
        for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {
                char *dname = d_name(di);
                if (dname[0] == '.' && (dname[1] == '\0'
                    || (dname[1] == '.' && dname[2] == '\0')))
                        continue;
                unsigned name_len = strlcpy(p, dname, remainder);

To:
        for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {
                char *dname = d_name(di);
                unsigned name_len;
                if (dname[0] == '.' && (dname[1] == '\0'
                    || (dname[1] == '.' && dname[2] == '\0')))
                        continue;
                name_len = strlcpy(p, dname, remainder);


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20110624/cc7d4e89/attachment.html>


More information about the rsync mailing list