bug-gnulib
[Top][All Lists]
Advanced

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

fnmatch does not compile with c++ (clang)


From: Sam Steingold
Subject: fnmatch does not compile with c++ (clang)
Date: Mon, 29 Aug 2016 18:52:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin)

Hi,
fnmatch cannot be compiled using c++ on mac os x:

--8<---------------cut here---------------start------------->8---
        g++ -DHAVE_CONFIG_H -I. -I../../src/gllib -I..  -I../intl 
-I/usr/local/include -I/usr/local/opt/readline/include  -W -Wswitch -Wcomment 
-Wpointer-arith -Wreturn-type -g -O0 -DDEBUG_OS_ERROR -DDEBUG_SPVW 
-DDEBUG_BYTECODE -DSAFETY=3 -DDEBUG_GCSAFETY -DUNIX_BINARY_DISTRIB 
-DENABLE_UNICODE -DNO_GETTEXT   -MT fnmatch.o -MD -MP -MF $depbase.Tpo -c -o 
fnmatch.o ../../src/gllib/fnmatch.c &&\
        mv -f $depbase.Tpo $depbase.Po
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is 
deprecated
In file included from ../../src/gllib/fnmatch.c:172:
../../src/gllib/fnmatch_loop.c:152:20: error: assigning to 'const char *' from 
incompatible type 'void *'
              endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L_('/') : L_('\0'),
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/gllib/fnmatch_loop.c:205:27: error: expected unqualified-id
            register bool not;
                          ^
../../src/gllib/fnmatch_loop.c:222:17: error: expected expression
            not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^')));
                ^
../../src/gllib/fnmatch_loop.c:223:20: error: expected expression
            if (not)
                   ^
../../src/gllib/fnmatch_loop.c:864:21: error: expected expression
            if (!not)
                    ^
../../src/gllib/fnmatch_loop.c:937:20: error: expected expression
            if (not)
                   ^
../../src/gllib/fnmatch_loop.c:269:29: error: cannot jump from this goto 
statement to its label
                            goto normal_bracket;
                            ^
../../src/gllib/fnmatch_loop.c:424:26: note: jump bypasses variable 
initialization
                    bool is_range = false;
                         ^
../../src/gllib/fnmatch_loop.c:238:21: error: cannot jump from this goto 
statement to its label
                    goto normal_bracket;
                    ^
../../src/gllib/fnmatch_loop.c:424:26: note: jump bypasses variable 
initialization
                    bool is_range = false;
                         ^
In file included from ../../src/gllib/fnmatch.c:269:
../../src/gllib/fnmatch_loop.c:205:27: error: expected unqualified-id
            register bool not;
                          ^
../../src/gllib/fnmatch_loop.c:222:17: error: expected expression
            not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^')));
                ^
../../src/gllib/fnmatch_loop.c:223:20: error: expected expression
            if (not)
                   ^
../../src/gllib/fnmatch_loop.c:864:21: error: expected expression
            if (!not)
                    ^
../../src/gllib/fnmatch_loop.c:937:20: error: expected expression
            if (not)
                   ^
../../src/gllib/fnmatch_loop.c:269:29: error: cannot jump from this goto 
statement to its label
                            goto normal_bracket;
                            ^
../../src/gllib/fnmatch_loop.c:424:26: note: jump bypasses variable 
initialization
                    bool is_range = false;
                         ^
../../src/gllib/fnmatch_loop.c:238:21: error: cannot jump from this goto 
statement to its label
                    goto normal_bracket;
                    ^
../../src/gllib/fnmatch_loop.c:424:26: note: jump bypasses variable 
initialization
                    bool is_range = false;
                         ^
../../src/gllib/fnmatch.c:313:28: error: assigning to 'wchar_t *' from 
incompatible type 'void *'
                  wpattern = malloc (totsize * sizeof (wchar_t));
                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 errors generated.
make[3]: *** [fnmatch.o] Error 1
--8<---------------cut here---------------end--------------->8---

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1404
http://www.childpsy.net/ http://camera.org http://www.memritv.org
http://iris.org.il http://dhimmi.org http://ffii.org
-Nervous?  -Yes!  -First time?  -No, I've been nervous before!



reply via email to

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