The C source codes that I am trying to port into 64 bit runs without any warning in the 32 bit environment. When I compile in 64 bit linux environment with the compile gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1, it shows the following warning mostly:
warning: cast to pointer from integer of different size
The above warning were the most. I used uintptr_t type and most of those warnings were removed. I could change the type int /unsigned int into 64 bit favorable using uintptr_t. But how can I change the following type to make compatible to 64 bit:
typedef void* POINTER;
I have changed the following code:
typedef unsigned int NAT;
into
typedef uintptr_t NAT
I got following warnings:
warning: passing argument 2 of ‘clause_ComputeSplitFieldAddress’ from incompatible pointer type
note: expected ‘NAT *’ but argument is of type ‘unsigned int *’
In function ‘clause_DependsOnSplitLevel’:
warning: passing argument 2 of ‘clause_ComputeSplitFieldAddress’ from incompatible pointer type
note: expected ‘NAT *’ but argument is of type ‘unsigned int *’
In function ‘clause_UpdateSplitDataFromNewSplitting’:
warning: passing argument 2 of ‘clause_ComputeSplitFieldAddress’ from incompatible pointer type
note: expected ‘NAT *’ but argument is of type ‘unsigned int *’
Moreover, after changing type def into uintptr_t which were earlier either int or unsigned int, I am encountering most of the warnings as follows:
warning: inlining failed in call to ‘tptp_StringCopy’: call is unlikely and code size would grow
warning: called from here
warning: inlining failed in call to ‘tptp_StringCopy’: call is unlikely and code size would grow
warning: called from here
warning: inlining failed in call to ‘tptp_StringCopy’: call is unlikely and code size would grow
The fuction tptp_StringCopy is as follows:
static __inline__ char* tptp_StringCopy(void)
{
char *copy;
copy = (char*) memory_Malloc(yyleng+1);
strcpy(copy, yytext);
return copy;
and the list_Cons is as follows:
static __inline__ LIST list_Cons(POINTER Ptr, const LIST List)
{
LIST Cell;
Cell = (LIST)memory_Malloc(sizeof(LIST_NODE));
Cell->car = Ptr;
Cell->cdr = List;
return Cell;
}
How can I get rid of these warnings?