1. ホーム

警告 警告: ポインタから異なるサイズの整数へのキャスト [-Wpointer-to-int-cast].

2022-02-25 07:59:29

警告

warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 1 
int *ret[5] ;
....
printf("-------%d 's ret = %d\n", i, (int)ret[i]); A type conversion warning occurred Solution.
printf("-------%d 's ret = %ld\n", i, (intptr_t )(int *)ret[i]) ;