Page MenuHome GnuPG

[patch] consistent mark include of readline.h (fixes older compiler error)
Closed, ResolvedPublic

Description

An older compiler has an error that newer compilers don't seem to care about
(redefinition of a typedef for function prototype):

In file included from ffi.c:44:
../../common/util.h:77: error: redefinition of typedef 'rl_completion_func_t'

This was noticed on a platform that had gcc 4.2

It looks like ffi.c doesn't mark the inclusion of readline.h the way all the
other places do (with #define GNUPG_LIBREADLINE_H_INCLUDED). Patch attached.

Maybe this isn't a problem with newer compilers, but it should be made
consistent with the way the rest of the code tree does #include
<readline/readline.h>.

It wasn't obvious why "#define GNUPG_LIBREADLINE_H_INCLUDED" was added in the
first place. The commit comment that introduced it was not very informative
("Various updates" in Sep 2006). I could see a case to remove that #define if
it's not actually necessary anymore, and disregard the failure with an old (now
unsupported) gcc.

Details

Version
2.1.15