[Linuxtrent] Re: warning: assignment from incompatible pointer type [enabled by default]

  • From: Antonio Galea <antonio.galea@xxxxxxxxx>
  • To: linuxtrent@xxxxxxxxxxxxx
  • Date: Mon, 19 Mar 2012 12:06:59 +0100

On Mon, Mar 19, 2012 at 11:52, Pietro <peter.zamb@xxxxxxxxx> wrote:
>
> l.c: In function ‘add_elem_to_list’:
> l.c:34:19: warning: assignment from incompatible pointer type [enabled by 
> default]
> l.c:36:13: warning: assignment from incompatible pointer type [enabled by 
> default]
> ...
>    // set the next point to the last in the list
>    l->last->next = &el;
>    // update the last in the list
>    l->last = &el;

La variabile el è già un puntatore, & è di troppo.

> Avete consigli su come risolvere il problema e migliorare lo stile del 
> sorgente?
> Grazie per l'aiuto ed i consigli...

Beh, lo stile si migliora con la pratica.

Antonio
--
Per iscriversi  (o disiscriversi), basta spedire un  messaggio con OGGETTO
"subscribe" (o "unsubscribe") a mailto:linuxtrent-request@xxxxxxxxxxxxx


Other related posts: