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: Ben Pfaff
Subject: Re: recent gnulib has problems with read, write and close within structs
Date: Mon, 14 Sep 2020 08:23:20 -0700

On Mon, Sep 14, 2020 at 01:54:14PM +0200, John Darrington wrote:
> On Sun, Sep 13, 2020 at 11:11:55PM +0200, Bruno Haible wrote:
>      
>      
>      The workaround is simple: Make sure that you include the corresponding 
> file -
>      here <unistd.h> - before the struct definition. That is, in this case,
>      at the beginning of ags/object/ags_application_context.h, add
>        #include <unistd.h>
>      
> 
> 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"

Why?  The following is a valid program:

    #include <unistd.h>

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

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



reply via email to

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