paul-j-lucas / cdecl

Composing and deciphering C (or C++) declarations or casts, aka ‘‘gibberish.’’
GNU General Public License v3.0
90 stars 11 forks source link

readline: deprecation warning. #5

Closed lrosenman closed 5 years ago

lrosenman commented 5 years ago

--- autocomplete.o --- autocomplete.c:381:39: warning: 'CPPFunction' is deprecated [-Wdeprecated-declarations] rl_attempted_completion_function = (CPPFunction*)attempt_completion; ^ /usr/local/include/readline/rltypedefs.h:38:47: note: 'CPPFunction' has been explicitly marked deprecated here typedef char **CPPFunction () attribute ((deprecated)); ^

Latest stuff from FreeBSD ports head.

paul-j-lucas commented 5 years ago

OK, try the readline-warning warning branch. As before, make sure to start fresh. Also, you'll get the POSIX warning again because this is a different branch. I'm interested only in the readline warning for this branch.

lrosenman commented 5 years ago

it doesn't seem(?) to honor --with-readline=/usr/local anymore, so I can't test it. :(

paul-j-lucas commented 5 years ago

That's bizarre. I'll have to try to figure out why not.

lrosenman commented 5 years ago

command line CC=clang ./configure --with-readline=/usr/local --prefix=/usr/local

log: https://www.lerctr.org/~ler/cdecl/config.log

lrosenman commented 5 years ago

I can give you access to my box if need be. (It's my home lab box).

paul-j-lucas commented 5 years ago

I just push'd. Try it again. I diff'd the two configure scripts and --with-readline is in both.

lrosenman commented 5 years ago

checking readline/readline.h usability... no checking readline/readline.h presence... no checking for readline/readline.h... no checking readline/history.h usability... no checking readline/history.h presence... no checking for readline/history.h... no

no dice..

447 cd GIT/cdecl 448 git pull -r 449 git clean -xdf 450 autoreconf -fiv 451 CC=clang ./configure --with-readline=/usr/local --prefix=/usr/local

generated configure script: https://www.lerctr.org/~ler/cdecl/configure config.log: https://www.lerctr.org/~ler/cdecl/config.log.2

paul-j-lucas commented 5 years ago

That part of the configure.ac file hasn't even changed.

lrosenman commented 5 years ago

No clue. but on the other branch it seems(!) to work.... I'll verify

paul-j-lucas commented 5 years ago

I pushed the yacc warning fix to master, FYI. And it's been merged into this branch.

lrosenman commented 5 years ago

Ok, but the readline warning stuff will NOT for the life of me pick up the readline prefix of /usr/local/ now.

as I said, I can give you access.

paul-j-lucas commented 5 years ago

So master doesn't work now either?

lrosenman commented 5 years ago

same on master.

paul-j-lucas commented 5 years ago

And you're sure the file /usr/include/readline/readline.h actually exists, right?

paul-j-lucas commented 5 years ago

I can try access... just not now. I'd need user-name/password info that's probably not good to give here.

lrosenman commented 5 years ago

no, /usr/local/include/readline/readline.h exists, the --with-readline=/usr/local is supposed to use that as a prefix..

[I] ➜ ls -l /usr/local/include/readline total 77 -rw-r--r-- 1 root wheel 4697 May 10 16:26 chardefs.h -rw-r--r-- 1 root wheel 10779 May 10 16:26 history.h -rw-r--r-- 1 root wheel 3260 May 10 16:26 keymaps.h -rw-r--r-- 1 root wheel 39338 May 10 16:26 readline.h -rw-r--r-- 1 root wheel 2829 May 10 16:26 rlconf.h -rw-r--r-- 1 root wheel 1835 May 10 16:26 rlstdc.h -rw-r--r-- 1 root wheel 3193 May 10 16:26 rltypedefs.h -rw-r--r-- 1 root wheel 3046 May 10 16:26 tilde.h

ler in cdecl at borg on  master [I] ➜

lrosenman commented 5 years ago

email me at ler at FreeBSD.org for access creds.

lrosenman commented 5 years ago

Here's the run with 6.4, and it finds readline:

http://home.lerctr.org:8888/data/live-host-ports/2019-06-19_15h37m01s/logs/cdecl-6.4_1.log

lrosenman commented 5 years ago

IF I set all the FLAGS (CFLAGS, CPPFLAGS, LDFLAGS) and JUST use --with-readline, it works and autocomplete.c compiles without warning. HOWEVER, IIRC, --with-readline=/usr/local is SUPPOSED TO* set all that for the readline tests, etc.

And prior to this change it seemed(?) to do the right thing, but now even on the master or cdecl-6.4 tag it breaks. I'm not sure what changed, but something(tm) is NOT right.

lrosenman commented 5 years ago

Mayhaps I'm misremembering, but if it finds readline now, it doesn't warn.

I'm not sure why I'm misremembering. :(

lrosenman commented 5 years ago

from: https://stackoverflow.com/questions/517580/library-resolution-with-autoconf

maybe that would help?

hdff="no"
hdffprefix="ERROR"
AC_ARG_WITH(hdf,[  --with-hdf              Compile with hdf library, for output.],[hdffprefix=$withval hdff="yes"],[])
# if there is no value given, it appears tha hdffprefix is set to "yes"
if test $hdffprefix = "yes" -a $hdff = "yes"
then
    echo "HDF: Attempting to find HDF"
    hdffprefix="ERROR"

    # check if hdffprefix is set, if it is not, it sets it to "ERROR" and the 
    # 'if' comparison evaluates to true
    if [[ "$hdffprefix" == "ERROR" ]]
    then
        echo "HDF: hdffprefix not set, searching PATH"
        for i in `echo $PATH | tr ':' '\n'`
        do
            if [[ $i == *hdf* ]]
            then
                if [[ $i == *bin/* ]]
                then
                    hdffprefix=${i%bin/}
                    # if it doesn't exist, re-set to ERROR
                    if [[ ! -f ${hdffprefix}include/hdf.h ]]
                    then
                    hdffprefix="ERROR"
                    fi
                elif [[ $i == *bin* ]]
                then
                    hdffprefix=${i%bin}
                    # if it doesn't exist, re-set to ERROR
                    if [[ ! -f ${hdffprefix}include/hdf.h ]]
                    then
                    hdffprefix="ERROR"
                    fi
                fi
            fi
        done
        if [[ "$hdffprefix" == "ERROR" ]]
        then
            echo "HDF: hdffprefix not found in PATH, trying 'which'"
            WHICH_TEST_HDF=`which hdf2gif`
            if [[ WHICH_TEST_HDF != "" ]]
            then
                hdffprefix=${WHICH_TEST_HDF%bin/hdf2gif}
            else
                echo "HDF: Warning - hdf not found"
            fi
        fi
    fi
    if [[ "$hdffprefix" != "ERROR" ]]
    then
        hdff="yes"
        echo "HDF found: $hdffprefix"
    fi
fi
if test $hdff = 'yes'; then
        hdfincs=" -DUSE_HDF -I"${hdffprefix}"include"
        scriptotherlibsinc=${scriptotherlibsinc}" -L"${hdffprefix}"/lib"
        scriptotherlibs=${scriptotherlibs}" -lmfhdf -ldf -ljpeg -lz"
    AC_CHECK_HEADERS([${hdffprefix}/include/hdf.h],,[AC_MSG_ERROR([Cannot find hdf.h])])
    AC_CHECK_HEADERS([${hdffprefix}/include/mfhdf.h],,[AC_MSG_ERROR([Cannot find mfhdf.h])])
fi
paul-j-lucas commented 5 years ago

OK, I figured it out. I pushed the change to master and to the readline-warning branch. I have no idea how this ever worked!

lrosenman commented 5 years ago

Yay! No warnings :). Thanks for looking at it.

paul-j-lucas commented 5 years ago

I also recently found out that the code doesn't work on 32-bit platforms, so I'm making changes for that. But I can close this.