aboutsummaryrefslogtreecommitdiffstats
path: root/src/mapi
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2020-05-22 14:37:38 -0700
committerKristian H. Kristensen <[email protected]>2020-05-26 12:46:18 -0700
commit12653beacba00146f5bf31816a7c1dc8e51735ff (patch)
treea2777e7d54011d2688e0df61304db2e06203b485 /src/mapi
parent8341f30f1ea87a22624031c2f5f670d1b9f8678a (diff)
mapi: Fix a couple of warning in generated code
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
Diffstat (limited to 'src/mapi')
-rw-r--r--src/mapi/glapi/gen/gl_marshal.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
index 6e8ad20f5cd..c7019a80328 100644
--- a/src/mapi/glapi/gen/gl_marshal.py
+++ b/src/mapi/glapi/gen/gl_marshal.py
@@ -37,7 +37,7 @@ header = """
#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;
@@ -336,7 +336,7 @@ class PrintCode(gl_XML.gl_print_base):
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 *')