[Spice-devel] [PATCH 12/18] Remove warnings from reds_stat utility

Frediano Ziglio fziglio at redhat.com
Tue Sep 27 13:44:37 UTC 2016


> 
> On Tue, Sep 27, 2016 at 02:56:44PM +0200, Pavel Grunt wrote:
> > On Tue, 2016-09-27 at 14:49 +0200, Christophe Fergeau wrote:
> > > On Mon, Sep 26, 2016 at 09:12:45AM +0100, Frediano Ziglio wrote:
> > > >      while (1) {
> > > > -        system("clear");
> > > > +        ignore_result(system("clear"));
> > > 
> > > 
> > > Dunno how robust it is wrt to future gcc versions. Could be
> > > assert(...)
> > > too even though not being able to clear the screen shouldn't be that
> > > critical.
> > what about g_warn_if_fail ?
> 
> Yup, good idea.
> 
> Christophe
> 

I would prefer the int res SPICE_GNUC_UNUSED method.
Currently there are no other reasons for Glib dependencies and not clearing
the screen is not such issue, actually would be much more confusing to
see a message in the middle of the output.

Personally the best option would be

   (void) system("clear");

which should be the standard C way... only if it worked on gcc...

Oh... another solution could be something like

   if (system("clear") != 0) {
       printf("\n\n\n");
   }

Frediano


More information about the Spice-devel mailing list