[Swan-dev] CentOS 6 "implicit declaration of function ‘printf’"

Andrew Cagney andrew.cagney at gmail.com
Thu Jun 20 20:16:17 UTC 2019


On Thu, 20 Jun 2019 at 09:57, Antony Antony <antony at phenome.org> wrote:
>
> On Wed, Jun 19, 2019 at 03:15:02PM -0400, Paul Wouters wrote:
> > On Tue, 18 Jun 2019, Andrew Cagney wrote:
> >
> > > why is a library function calling printf()? (if a c file needs
> > > something #include it).
> >
> > Because it is used in addconn which has no logging mechanism and only
> > uses stdout?
>
> what is the latest status of logs from adconn? They seems to disappear in
> test testrun. That is my recollection. That is why I left the printfs there,
> when I refacatored from addconn to addr_lookup.c. Now this used by pluto and
> and addconn.
>
> What is a better way log from library function in addr_lookup.c?

I'd use libreswan_log() and tweak:

               case 'D':
                        verbose++;
                        lex_verbosity++;
                        break;

to also set log_to_stderr=true.  It will then print:

     addconn: ....

on stderr when verbose.


More information about the Swan-dev mailing list