(Crossposted to gcc-help and elinks-dev)

In ELinks, we're using unsigned char almost everywhere.
This convention was apparently inherited from Links.
I think the purpose might be to reduce the need for casts
in <ctype.h> calls and charset conversions.

Then we have functions like

  void elinks_debug(unsigned char *fmt, ...);

that take a format string and arguments.  It would be nice to
have GCC check that the types of those arguments match the format
string.  But if I declare the function as

  void elinks_debug(unsigned char *fmt, ...)
        __attribute__((format(printf, 1, 2)));

then GCC 4.3.1 rejects it, even with -Wno-pointer-sign:

/home/Kalle/src/elinks-0.12/src/util/error.h:23: error: format string argument 
not a string type

If I change the unsigned char * to char *, then this error goes
away.  But is there any other way to make GCC check the format
arguments without this error?
_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to