Re: Problem with type safety and the "sentinel" attribute

2006-06-13 Thread Stefan Westerfeld
Hi! On Fri, Jun 09, 2006 at 07:30:25PM +0200, Tim Janik wrote: > On Fri, 9 Jun 2006, Kaveh R. Ghazi wrote: > >> void print_string_array (const char *array_name, > >> const char *string, ...) __attribute__ > >> ((__sentinel__)); >

Re: Problem with type safety and the "sentinel" attribute

2006-06-09 Thread Tim Janik
thanks for the quick response Kaveh. On Fri, 9 Jun 2006, Kaveh R. Ghazi wrote: > void print_string_array (const char *array_name, > const char *string, ...) __attribute__ > ((__sentinel__)); > > print_string_array ("empty_arra

Re: Problem with type safety and the "sentinel" attribute

2006-06-09 Thread Kaveh R. Ghazi
> void print_string_array (const char *array_name, > const char *string, ...) __attribute__ > ((__sentinel__)); > > print_string_array ("empty_array", NULL); /* gcc warns, but shouldn't */ > > The only way out for keeping

Problem with type safety and the "sentinel" attribute

2006-06-09 Thread Stefan Westerfeld
Hi! I recently tried to add sentinel attributes to the beast code, and found that the way gcc treats sentinels right now, we need to make a trade off between type safety against the sentinel NULL termination check. The GNOME bugzilla link is here: http://bugzilla.gnome.org/show_bug.cgi?id=34