[Spice-devel] [spice-common 1/2] pixman: Use g_error() rather than g_abort()

Frediano Ziglio fziglio at redhat.com
Fri Jul 6 18:58:56 UTC 2018


> 
> ACK series
> 
> On Fri, 2018-07-06 at 17:44 +0200, Christophe Fergeau wrote:
> > g_abort() was only added in glib 2.50, which causes meson build
> > failures
> > since this defines GLIB_VERSION_MIN_REQUIRED/GLIB_VERSION_MAX_ALLOWED
> > 
> > Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
> > ---
> >  common/pixman_utils.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/common/pixman_utils.c b/common/pixman_utils.c
> > index b7cf25c..c573574 100644
> > --- a/common/pixman_utils.c
> > +++ b/common/pixman_utils.c
> > @@ -935,8 +935,7 @@ pixman_format_code_t
> > spice_surface_format_to_pixman(uint32_t surface_format)
> >      case SPICE_SURFACE_FMT_32_ARGB:
> >          return PIXMAN_a8r8g8b8;
> >      default:
> > -        printf("Unknown surface format %d\n", surface_format);
> > -        g_abort();
> > +        g_error("Unknown surface format %d\n", surface_format);
> >          break;
> >      }
> >          return (pixman_format_code_t)0; /* Not reached */
> > @@ -974,8 +973,7 @@ pixman_format_code_t
> > spice_bitmap_format_to_pixman(int bitmap_format,
> >  
> >      case SPICE_BITMAP_FMT_INVALID:
> >      default:
> > -        printf("Unknown bitmap format %d\n", bitmap_format);
> > -        g_abort();
> > +        g_error("Unknown bitmap format %d\n", bitmap_format);
> >          return PIXMAN_a8r8g8b8;
> >      }
> >  }

I'm glad we are going to support Windows.. but do we really need
to support debugging with gdb under Windows?
For who don't understand the question above... why we needed to
add a regression using g_abort instead of abort which is C89 so
expected to be supported about 30 years ago?
We fixed a problem with Meson/autotools and removed some printf
but all started with this regression.

OT: about Meson/autotools maybe we should check the macros definition
used by autotools and Meson? If I remember you can get with
"cc -E -dM ..." or something like that.

Frediano


More information about the Spice-devel mailing list