bug-gnulib
[Top][All Lists]
Advanced

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

Re: recent gnulib has problems with read, write and close within structs


From: Bruno Haible
Subject: Re: recent gnulib has problems with read, write and close within structs
Date: Mon, 14 Sep 2020 18:06:38 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; )

John Darrington wrote:
> I don't think this will solve all problems.
> 
> For example if you have:
> 
> 
> 
> #include <unistd.h>
> 
> struct foo
> {
>         void write (char *);
> };
> 
> func (struct foo *f)
> {
>    f->write ("hello");
> }
> 
> 
> 
> then one will get an error similar to "rpl_write is not a member of foo"

Huh? If <unistd.h> does '#define write rpl_write', then the preprocessed code
is:

struct foo
{
        void rpl_write (char *);
};

func (struct foo *f)
{
   f->rpl_write ("hello");
}

and this will compile fine.

Bruno




reply via email to

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