PATCH] OS: Add some noreturn and printf compiler attributes where appropriate

Rami Ylimäki ext-rami.ylimaki at nokia.com
Mon Mar 29 02:18:57 PDT 2010


ext Mark Kettenis wrote:
> Given the fact that the "noreturn" attribute makes GCC generate code
> that makes debugging hard (see the recent discussion about adding some
> arm-specific compiler flags as a countermeasure), it's probably best
> to keep its usage to the absolute minimum.
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>   

True, currently everything is fine if the "noreturn" function is defined 
in os/log.c, because that is compiled with "-mapcs-frame". The patch 
introduces the following change:

-extern _X_EXPORT void OsAbort (void);
+extern _X_EXPORT void OsAbort (void) _noreturn_attribute;


OsAbort is defined in os/utils.c so some changes are needed to prevent 
problems with ARM.

1. Move OsAbort to os/log.c.
2. Or add os/utils.c to the list of files compiled with "-mapcs-frame" 
in os/Makefile.am.
3. Or remove the noreturn attribute for OsAbort.

-- Rami



More information about the xorg-devel mailing list