diff --git a/compute/pzlansy.c b/compute/pzlansy.c
index e87d6a19f1af4c14b51aaaa33d0a19e2320ff641..2c6265ee55ef41479c671376fb06e075d3cebd48 100644
--- a/compute/pzlansy.c
+++ b/compute/pzlansy.c
@@ -23,9 +23,6 @@
  */
 //ALLOC_WS :  A->mb
 //WS_ADD :  A->mb
-
-#include <stdlib.h>
-#include <math.h>
 #include "control/common.h"
 
 #define A( m, n )        A,     (m), (n)
diff --git a/control/async.c b/control/async.c
index 0e7001d29c10a1c81eb84cbaa1e8a50df49fbc6f..5eea9670b1ca115eca94c71df2f037dde6803e5b 100644
--- a/control/async.c
+++ b/control/async.c
@@ -24,7 +24,6 @@
  * @brief Group routines exposed to users to handle asynchronous tasks execution
  *
  */
-#include <stdlib.h>
 #include "control/common.h"
 #include "chameleon/runtime.h"
 
@@ -344,4 +343,4 @@ int CHAMELEON_Request_Set( RUNTIME_request_t *request, int param, int value)
 
     status = chameleon_request_set(chamctxt, request, param, value);
     return status;
-}
\ No newline at end of file
+}
diff --git a/control/chameleon_f77.c b/control/chameleon_f77.c
index 6751e4882c504b795ded51419a73a1b9379ee318..a247a75b9c3a4195220ba5f43fb298dd74550294 100644
--- a/control/chameleon_f77.c
+++ b/control/chameleon_f77.c
@@ -20,7 +20,6 @@
  * @date 2020-03-12
  *
  */
-#include <stdlib.h>
 #include "control/common.h"
 #include "chameleon.h"
 #include "chameleon_f77.h"
diff --git a/control/chameleon_mf77.c b/control/chameleon_mf77.c
index 76ddb5a5a3c9a72b232de653c52b41011e18fb50..2a43c778eb0204a7015520e8bfdba3d03aee73e5 100644
--- a/control/chameleon_mf77.c
+++ b/control/chameleon_mf77.c
@@ -19,7 +19,6 @@
  * @date 2020-03-03
  *
  */
-#include <stdlib.h>
 #include "control/common.h"
 
 #define CHAMELEON_ZCGESV           CHAMELEON_FNAME(zcgesv,   ZCGESV)
diff --git a/control/chameleon_zf77.c b/control/chameleon_zf77.c
index f5f4a37ca636aa818e43c007e3dc7b5158538794..611740889f56b5751fd7f9dea3f46a36661eb10b 100644
--- a/control/chameleon_zf77.c
+++ b/control/chameleon_zf77.c
@@ -24,7 +24,6 @@
  * @precisions normal z -> c d s
  *
  */
-#include <stdlib.h>
 #include "control/common.h"
 #include "control/chameleon_f77.h"
 
diff --git a/control/common.h b/control/common.h
index 44b628b40ab0078428a3120da929f2fcc0659aed..ed2daacc04f7c7389b6fe3816a38a3f9a0dec08c 100644
--- a/control/common.h
+++ b/control/common.h
@@ -25,6 +25,15 @@
 #ifndef _chameleon_common_h_
 #define _chameleon_common_h_
 
+#define _GNU_SOURCE 1
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+/**
+ *  Chameleon header files
+ */
+#include "chameleon.h"
 
 #if defined( _WIN32 ) || defined( _WIN64 )
 #include <io.h>
@@ -63,11 +72,6 @@
 #define LAPACK_NAME(a, b) lapackef77_##a
 #endif
 
-/**
- *  Chameleon header files
- */
-#include "chameleon.h"
-
 #include "control/global.h"
 #include "control/auxiliary.h"
 #include "control/context.h"
@@ -118,6 +122,22 @@ void chameleon_pslag2d(CHAM_context_t *chamctxt);
 void chameleon_pclag2z(CHAM_context_t *chamctxt);
 */
 
+#if defined(__GNUC__)
+static inline void chameleon_asprintf( char **strp, const char *fmt, ... ) __attribute__((format(printf,2,3)));
+#endif
+static inline void chameleon_asprintf( char **strp, const char *fmt, ... )
+{
+    va_list ap;
+    int rc;
+
+    va_start( ap, fmt );
+    rc = asprintf( strp, fmt, ap );
+    va_end(ap);
+
+    assert( rc != -1 );
+    (void)rc;
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/control/control.c b/control/control.c
index 5fc134b38e3a54270b68677fc3f0db9ffbde0e4b..52f7385176330aa928cd289dfe163067ad8dc55c 100644
--- a/control/control.c
+++ b/control/control.c
@@ -26,10 +26,6 @@
  * @brief Group routines exposed to users to control CHAMELEON state
  *
  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "control/auxiliary.h"
 #include "control/common.h"
 #include "chameleon/runtime.h"
 
diff --git a/control/descriptor.c b/control/descriptor.c
index a24164cd6fd9a8c12f5ca6a77f9b569c2ee4e63c..0f3e9def70c48445e0b1dcd6863d40b9a042eb1b 100644
--- a/control/descriptor.c
+++ b/control/descriptor.c
@@ -105,7 +105,7 @@ void chameleon_desc_init_tiles( CHAM_desc_t *desc )
             tile->mat = (rank == desc->myrank) ? desc->get_blkaddr( desc, ii, jj ) : NULL;
             tile->ld  = desc->get_blkldd( desc, ii );
 #if defined(CHAMELEON_KERNELS_TRACE)
-            asprintf( &(tile->name), "%s(%d,%d)", desc->name, ii, jj);
+            chameleon_asprintf( &(tile->name), "%s(%d,%d)", desc->name, ii, jj );
 #endif
         }
     }
@@ -128,6 +128,7 @@ int chameleon_getrankof_2d_diag( const CHAM_desc_t *A, int m, int n )
 {
     int mm = m + A->i / A->mb;
     assert( m == n );
+    (void)n;
     return (mm % A->p) * A->q + (mm % A->q);
 }
 
diff --git a/control/descriptor.h b/control/descriptor.h
index fc239a56964d9dbc8424351d46eae4fbc5689cb2..c788bcb4336fe73e8e9231927a140abe096af53b 100644
--- a/control/descriptor.h
+++ b/control/descriptor.h
@@ -70,6 +70,9 @@ static inline int chameleon_desc_init( CHAM_desc_t *desc, void *mat,
     assert( i == 0 );
     assert( j == 0 );
     assert( mb * nb == bsiz );
+    (void)bsiz;
+    (void)i;
+    (void)j;
     return chameleon_desc_init_internal( desc, NULL, mat, dtyp, mb, nb, lm, ln, m, n, p, q,
                                          get_blkaddr, get_blkldd, get_rankof );
 }
@@ -138,6 +141,7 @@ inline static void *chameleon_getaddr_cm(const CHAM_desc_t *A, int m, int n)
 inline static void *chameleon_getaddr_diag( const CHAM_desc_t *A, int m, int n )
 {
     assert( m == n );
+    (void)n;
     return chameleon_getaddr_ccrb( A, m, 0 );
 }
 
diff --git a/control/descriptor_rec.c b/control/descriptor_rec.c
index 1bc506b6566165cd07929b86773969ddc8ca228f..d595ec08b043b77ffff98ad4aba3132237f9025d 100644
--- a/control/descriptor_rec.c
+++ b/control/descriptor_rec.c
@@ -76,7 +76,8 @@ chameleon_recdesc_create( const char *name, CHAM_desc_t **descptr, void *mat, ch
             tile = desc->get_blktile( desc, m, n );
             tempmm = m == desc->mt-1 ? desc->m - m * desc->mb : desc->mb;
             tempnn = n == desc->nt-1 ? desc->n - n * desc->nb : desc->nb;
-            asprintf( &subname, "%s[%d,%d]", name, m, n );
+
+            chameleon_asprintf( &subname, "%s[%d,%d]", name, m, n );
 
             chameleon_recdesc_create( subname, &tiledesc, tile->mat,
                                       desc->dtyp, mb, nb,
diff --git a/control/workspace.c b/control/workspace.c
index 8375e8ab75d8a796126c42155d578a72e163f4c4..28581d42bd7bf571168ac03bcbbf8e257f702ef2 100644
--- a/control/workspace.c
+++ b/control/workspace.c
@@ -23,8 +23,6 @@
  * @brief Group routines exposed to users about specific workspaces management
  *
  */
-
-#include <stdlib.h>
 #include "control/common.h"
 #include "control/auxiliary.h"
 #include "control/workspace.h"
diff --git a/coreblas/compute/core_zcesca.c b/coreblas/compute/core_zcesca.c
index 989e48b82ad718b41d0975628368df85ba39c232..3f81f42700876a90c0410667004497202634b90a 100644
--- a/coreblas/compute/core_zcesca.c
+++ b/coreblas/compute/core_zcesca.c
@@ -136,6 +136,9 @@ int CORE_zcesca( int center, int scale,
     CHAMELEON_Complex64_t gi, gj, g, rc, sqrc;
     double di, dj;
 
+    gj = 0.;
+    dj = 0.;
+
     /* Check input arguments */
     if ( (center != 0) && (center != 1) ) {
         coreblas_error(1, "Illegal value of center");
diff --git a/runtime/parsec/control/runtime_descriptor.c b/runtime/parsec/control/runtime_descriptor.c
index b78181685fa9bb401dfa1582ff47ad35a8137557..ef92ded5cc384f56d7dcc7fdc38e17036a41fd17 100644
--- a/runtime/parsec/control/runtime_descriptor.c
+++ b/runtime/parsec/control/runtime_descriptor.c
@@ -229,11 +229,9 @@ void RUNTIME_desc_create( CHAM_desc_t *mdesc )
     data_collection->vpid_of_key = chameleon_parsec_vpid_of_key;
 #if defined(PARSEC_PROF_TRACE)
     {
-        int rc;
         data_collection->key_to_string = chameleon_parsec_key_to_string;
         data_collection->key           = NULL;
-        rc = asprintf(&(data_collection->key_dim), "(%d, %d)", mdesc->lmt, mdesc->lnt);
-        (void)rc;
+        chameleon_asprintf(&(data_collection->key_dim), "(%d, %d)", mdesc->lmt, mdesc->lnt);
     }
 #endif
     data_collection->memory_registration_status = MEMORY_STATUS_UNREGISTERED;
diff --git a/runtime/starpu/codelets/codelet_zplssq.c b/runtime/starpu/codelets/codelet_zplssq.c
index 22179ff0032ca18bdc7a1ca5cea47bb4c6b03df6..187ceb3e66270737e4f281cb8d90c9d7d7b32f1c 100644
--- a/runtime/starpu/codelets/codelet_zplssq.c
+++ b/runtime/starpu/codelets/codelet_zplssq.c
@@ -21,7 +21,6 @@
  * @precisions normal z -> c d s
  *
  */
-#include <math.h>
 #include "chameleon_starpu.h"
 #include "runtime_codelet_z.h"
 
diff --git a/runtime/starpu/control/runtime_async.c b/runtime/starpu/control/runtime_async.c
index 6d7260d6364d9c3b0f2cd5e7ba389298c2301169..cc229cd068585a8c5f8797c2aeb738627c397318 100644
--- a/runtime/starpu/control/runtime_async.c
+++ b/runtime/starpu/control/runtime_async.c
@@ -19,7 +19,6 @@
  * @date 2020-04-22
  *
  */
-#include <stdlib.h>
 #include "chameleon_starpu.h"
 
 /**
@@ -36,7 +35,7 @@ int RUNTIME_sequence_create( CHAM_context_t  *chamctxt,
 /**
  *  Destroy a sequence
  */
-int RUNTIME_sequence_destroy( CHAM_context_t  *chamctxt,
+int RUNTIME_sequence_destroy( CHAM_context_t     *chamctxt,
                               RUNTIME_sequence_t *sequence )
 {
     (void)chamctxt;
@@ -47,7 +46,7 @@ int RUNTIME_sequence_destroy( CHAM_context_t  *chamctxt,
 /**
  *  Wait for the completion of a sequence
  */
-int RUNTIME_sequence_wait( CHAM_context_t  *chamctxt,
+int RUNTIME_sequence_wait( CHAM_context_t     *chamctxt,
                            RUNTIME_sequence_t *sequence )
 {
     (void)chamctxt;
@@ -73,7 +72,7 @@ int RUNTIME_sequence_wait( CHAM_context_t  *chamctxt,
 /**
  *  Terminate a sequence
  */
-void RUNTIME_sequence_flush( CHAM_context_t  *chamctxt,
+void RUNTIME_sequence_flush( CHAM_context_t     *chamctxt,
                              RUNTIME_sequence_t *sequence,
                              RUNTIME_request_t  *request,
                              int status )
@@ -88,7 +87,7 @@ void RUNTIME_sequence_flush( CHAM_context_t  *chamctxt,
 /**
  *  Create a request
  */
-int RUNTIME_request_create( CHAM_context_t  *chamctxt,
+int RUNTIME_request_create( CHAM_context_t    *chamctxt,
                             RUNTIME_request_t *request )
 {
     (void)chamctxt;
@@ -140,4 +139,4 @@ int RUNTIME_request_set( CHAM_context_t  *chamctxt,
     }
 
     return CHAMELEON_SUCCESS;
-}
\ No newline at end of file
+}
diff --git a/runtime/starpu/control/runtime_context.c b/runtime/starpu/control/runtime_context.c
index 177605ca9fcb63349bdaf7855122e93170ba38e3..176b9cbbb9aa1d82f3c00dc6b0408896d505cf38 100644
--- a/runtime/starpu/control/runtime_context.c
+++ b/runtime/starpu/control/runtime_context.c
@@ -19,7 +19,6 @@
  * @date 2020-12-01
  *
  */
-#include <stdlib.h>
 #include "chameleon_starpu.h"
 
 /**
diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c
index 7561f2e4fca742f1d35a9b43f5c0099b09bf51fb..611634699907dce78695388556b7827a88fb4938 100644
--- a/runtime/starpu/control/runtime_control.c
+++ b/runtime/starpu/control/runtime_control.c
@@ -21,9 +21,9 @@
  * @date 2020-07-01
  *
  */
+#include "chameleon_starpu.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include "chameleon_starpu.h"
 #if defined(STARPU_USE_FXT)
 #include <starpu_fxt.h>
 #endif
diff --git a/runtime/starpu/control/runtime_descriptor.c b/runtime/starpu/control/runtime_descriptor.c
index 8d20b3afa95dbcde2e7deef0171d4de4c3460450..4ab987d2bb4546a3ab0db510806d6c56b7d04eda 100644
--- a/runtime/starpu/control/runtime_descriptor.c
+++ b/runtime/starpu/control/runtime_descriptor.c
@@ -22,8 +22,6 @@
  * @date 2020-12-01
  *
  */
-#include <stdlib.h>
-#include <unistd.h>
 #include "chameleon_starpu.h"
 
 /**
diff --git a/runtime/starpu/control/runtime_options.c b/runtime/starpu/control/runtime_options.c
index 553fed070e13a0a2407692431792dab777d8f317..6687984b2d56f62bb7a8c1369bab5c3191c10405 100644
--- a/runtime/starpu/control/runtime_options.c
+++ b/runtime/starpu/control/runtime_options.c
@@ -19,8 +19,6 @@
  * @date 2020-01-07
  *
  */
-#include <stdio.h>
-#include <stdlib.h>
 #include "chameleon_starpu.h"
 
 void RUNTIME_options_init( RUNTIME_option_t *option, CHAM_context_t *chamctxt,
diff --git a/runtime/starpu/control/runtime_profiling.c b/runtime/starpu/control/runtime_profiling.c
index 4881cadeebfb166d8c34d48678d280edc977272a..fb8fc039fc8a06e4ac09aa05f9cf613f9a709d03 100644
--- a/runtime/starpu/control/runtime_profiling.c
+++ b/runtime/starpu/control/runtime_profiling.c
@@ -20,8 +20,8 @@
  * @date 2020-03-03
  *
  */
-#include <math.h>
 #include "chameleon_starpu.h"
+#include <math.h>
 #if defined(STARPU_USE_FXT)
 #include <starpu_fxt.h>
 #endif
diff --git a/runtime/starpu/include/chameleon_starpu.h.in b/runtime/starpu/include/chameleon_starpu.h.in
index c2ac71d22cab33200716a75dda3c7ceb62544226..e9fc23d52967610ab53ad3a99fd2736f80041782 100644
--- a/runtime/starpu/include/chameleon_starpu.h.in
+++ b/runtime/starpu/include/chameleon_starpu.h.in
@@ -23,7 +23,7 @@
 #ifndef _chameleon_starpu_h_
 #define _chameleon_starpu_h_
 
-#include "chameleon/config.h"
+#include "control/common.h"
 
 /* StarPU options */
 #cmakedefine HAVE_STARPU_IDLE_PREFETCH
diff --git a/testing/testing_zcheck.c b/testing/testing_zcheck.c
index 2bc8ceb11edfb9a793a8c5931ae28abb0c9bac2c..35b044b4a870930805e3d95f46977081e8e6622e 100644
--- a/testing/testing_zcheck.c
+++ b/testing/testing_zcheck.c
@@ -18,6 +18,7 @@
  * @precisions normal z -> c d s
  *
  */
+#include "../control/common.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -33,7 +34,6 @@
 #if defined(CHAMELEON_USE_MPI)
 #include <mpi.h>
 #endif
-#include "../control/common.h"
 #include "testings.h"
 #include "testing_zcheck.h"
 #include <chameleon/flops.h>
diff --git a/testing/testing_zgels.c b/testing/testing_zgels.c
index df61a7ad3b4217afd11eccd2f772b20187e6d91f..9e63a8020d557b854e1ae77037f46643ff591121 100644
--- a/testing/testing_zgels.c
+++ b/testing/testing_zgels.c
@@ -17,11 +17,11 @@
  * @precisions normal z -> c d s
  *
  */
+#include "../control/common.h"
 #include <chameleon.h>
 #include "testings.h"
 #include "testing_zcheck.h"
 #include <chameleon/flops.h>
-#include "../control/common.h"
 
 static cham_fixdbl_t
 flops_zgels( cham_trans_t trans, int M, int N, int NRHS )
diff --git a/testing/testing_zgels_hqr.c b/testing/testing_zgels_hqr.c
index e897ac7ae5002a7b815e7a32e264729e0a723304..f0227671a35a880f44ca6bcf56afc7a423270e89 100644
--- a/testing/testing_zgels_hqr.c
+++ b/testing/testing_zgels_hqr.c
@@ -17,11 +17,11 @@
  * @precisions normal z -> c d s
  *
  */
+#include "../control/common.h"
 #include <chameleon.h>
 #include "testings.h"
 #include "testing_zcheck.h"
 #include <chameleon/flops.h>
-#include "../control/common.h"
 
 static cham_fixdbl_t
 flops_zgels_hqr( cham_trans_t trans, int M, int N, int NRHS )