[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Fix warnings in Xen C code



On 13 Aug 2015, at 18:44, Len Maxwell <len@xxxxxxxx> wrote:

Now I understand why fprintf was a macro pointing to printk -- it seems to defeat the builtin inlining and saves us implementing fputs, etc. in order to get diagnostic output from the OCaml runtime.  The mini-os print/printk does a sprintf to a buffer and sends that out via the console ring.

Enabling -fno-builtin across xen-ocaml could hurt performance.  From [1]: "GCC normally generates special code to handle certain built-in functions more efficiently; for instance, calls to alloca may become single instructions which adjust the stack directly, and calls to memcpy may become inline copy loops."

I'll find another way to clean up the warnings.  Thanks.


Yeah, turning off builtins across the board is not ideal, but it's absolutely fine to turn them off selectively.  The printf builtin in gcc may also be used for format string checking as well, so be careful about disabling other unrelated safety checks as well.

One thing that it would be wonderful to do is to undo some of the #define hacks that have been in MiniOS for historical reasons.  Now that we have better structured header files, it would be good to have explicit prototypes instead of #defines for functions like printf, and not just redirect them at the cpp level to calls to printk.

-a

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.