safe_mul may not be used and clang doesn't understand the "optimize"
attribute.
src/mapi/glapi/gen/marshal_generated0.c:1216:16: warning: unknown
attribute 'optimize' ignored [-Wunknown-attributes]
src/mapi/glapi/gen/marshal_generated0.c:36:19: warning: unused
function 'safe_mul' [-Wunused-function]
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
#define COMPAT (ctx->API != API_OPENGL_CORE)
-static inline int safe_mul(int a, int b)
+UNUSED static inline int safe_mul(int a, int b)
{
if (a < 0 || b < 0) return -1;
if (a == 0 || b == 0) return 0;
def print_create_marshal_table(self, api):
out('/* _mesa_create_marshal_table takes a long time to compile with -O2 */')
- out('#ifdef __GNUC__')
+ out('#if defined(__GNUC__) && !defined(__clang__)')
out('__attribute__((optimize("O1")))')
out('#endif')
out('struct _glapi_table *')