This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Assignment makes pointer from integer without a cast




> -----Original Message-----
> From: Lord Byron [mailto:lordbyronbr@yahoo.com]
> Sent: Wednesday, March 20, 2002 2:16 PM
> To: gcc@gcc.gnu.org
> Subject: Assignment makes pointer from integer without a cast
> 
> 
> I am using a function like this:
> 
> (...)
> 
> short int analyze(long int *id)
> {
>    long int tid;
>    tid = 2001;
>    id = tid;
> }
> 
> The gcc compiler gives a warning: "assignment makes
> pointer from integer without a cast", but if I do
> this:
>    *id = tid;
> when it's running, it causes a Bus Error

Perhaps look at the code that calls analyze, and check what is passed as
parameter?

        Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
-------------------------------------------- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]