← Back to team overview

maria-developers team mailing list archive

Re: [Commits] ab0943d5b11: Fix gcc 6.3.x compiler warnings.

 

On Thu, Feb 16, 2017 at 10:26 AM, jan <jan.lindstrom@xxxxxxxxxxx> wrote:

> revision-id: ab0943d5b11f01fb3f4638134bd1b8fb6a14a5e0 (mariadb-5.5.54-23-
> gab0943d5b11)
> parent(s): 2e8fa1c2b2867b99b5cc7f987ad64b666e0af2c4
> author: Jan Lindström
> committer: Jan Lindström
> timestamp: 2017-02-16 10:25:27 +0200
> message:
>
> Fix gcc 6.3.x compiler warnings.
>
> These are caused by fact that functions are declared with
> __attribute__((nonnull)) or left shit like ~0 << macro
> when ~0U << macro should be used.
>

OK to push, except for the following unrelated changes (which are OK in a
separate commit):

diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/
> trx0trx.h
> index 4ade245f03e..94707ecf7cb 100644
> --- a/storage/innobase/include/trx0trx.h
> +++ b/storage/innobase/include/trx0trx.h
> @@ -481,6 +481,7 @@ struct trx_struct{
>                                         of view of concurrency control:
>                                         TRX_ACTIVE,
> TRX_COMMITTED_IN_MEMORY,
>                                         ... */
> +       os_thread_id_t   thread_id;
>         /*------------------------------*/
>         /* MySQL has a transaction coordinator to coordinate two phase
>                 commit between multiple storage engines and the binary
> log. When
> diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/
> trx0trx.c
> index 2d585b7507f..9a80478f6f1 100644
> --- a/storage/innobase/trx/trx0trx.c
> +++ b/storage/innobase/trx/trx0trx.c
> @@ -40,6 +40,7 @@ Created 3/26/1996 Heikki Tuuri
>  #include "srv0srv.h"
>  #include "btr0sea.h"
>  #include "os0proc.h"
> +#include "os0thread.h"
>  #include "trx0xa.h"
>  #include "trx0purge.h"
>  #include "ha_prototypes.h"
> @@ -97,7 +98,6 @@ trx_create(
>         trx_t*  trx;
>
>         ut_ad(mutex_own(&kernel_mutex));
> -       ut_ad(sess);
>
>         trx = mem_alloc(sizeof(trx_t));
>
> @@ -1770,7 +1770,7 @@ trx_print(
>  {
>         ibool   newline;
>
> -       fprintf(f, "TRANSACTION " TRX_ID_FMT, (ullint) trx->id);
> +       fprintf(f, "TRANSACTION " TRX_ID_FMT " OS thread %lu", (ullint)
> trx->id, trx->thread_id);
>
>         switch (trx->conc_state) {
>         case TRX_NOT_STARTED:
>

Furthermore, I think that in that separate commit for adding these, a macro
could be useful instead of "%lu", because pthread_t may be incompatible
with "%lu".

Marko
-- 
DON’T MISS
M|17
April 11 - 12, 2017
The Conrad Hotel
New York City
https://m17.mariadb.com/

Marko Mäkelä, Lead Developer InnoDB
MariaDB Corporation