By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,321 Members | 1,909 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,321 IT Pros & Developers. It's quick & easy.

warning: assignment makes pointer from integer without a cast

drhowarddrfine
Expert 5K+
P: 7,435
warning: assignment makes pointer from integer without a cast

I get that when I compile a C file where the function is defined as this:
char **getvars()

and the calling function has this declared:
char **s;

and I write:
s=getvars();

What am I forgetting?
May 18 '07 #1
Share this Question
Share on Google+
10 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Never mind. getvars() wasn't in my prototypes and that was the cause.
May 18 '07 #2

drhowarddrfine
Expert 5K+
P: 7,435
I'm back. I'm getting the error again and it seems inconsistent. Yes, I'm changing things in the body of the code but sometimes this warnings pops up and other times it doesn't. Anyone see anything I'm missing?
May 18 '07 #3

drhowarddrfine
Expert 5K+
P: 7,435
Ok, I found out there was another include file I forgot to include and now it's solved.
May 19 '07 #4

Savage
Expert 100+
P: 1,764
Ok, I found out there was another include file I forgot to include and now it's solved.
Are u OK?

Do u have temperature?

Savage
May 19 '07 #5

AdrianH
Expert 100+
P: 1,251
Are u OK?

Do u have temperature?

Savage
I think the dr. needs a Doctor. :D dr., you should know better then to post a question with not enough info to solve it. ;) Might have to tell Mary on you.


Adrian
May 19 '07 #6

Expert 10K+
P: 11,448
As a rule of thumb: when the compiler complains about a cast you know that
there was no prototype in scope which usually means that you forgot to mention
an include file; especially when the element (function) wasn't yours.

kind regards,

Jos
May 19 '07 #7

drhowarddrfine
Expert 5K+
P: 7,435
Yeah, I don't have problems with pointers but the pointer to pointer syntax is what I thought was screwed up. I did have that messed up, too, as it turned out but it works now.

We don't have these problems in assembly language. Everything should be done in assembly.
May 19 '07 #8

AdrianH
Expert 100+
P: 1,251
Yeah, I don't have problems with pointers but the pointer to pointer syntax is what I thought was screwed up. I did have that messed up, too, as it turned out but it works now.

We don't have these problems in assembly language. Everything should be done in assembly.
LOL, yeah. I think I would rather die from a thousand cuts.


Adrian
May 19 '07 #9

Savage
Expert 100+
P: 1,764
Yeah, I don't have problems with pointers but the pointer to pointer syntax is what I thought was screwed up. I did have that messed up, too, as it turned out but it works now.

We don't have these problems in assembly language. Everything should be done in assembly.
No thank u.

I will rather mess up with pointer to pointer syntax.

Savage
May 19 '07 #10

P: 2
Hello,

I got the same warning using strrch() function:
compileing with GNU gcc 3.3.2 the following code:

# include <stdio.h>
#include <math.h>
:
{
char line[1000];
char comment=';';
int c0;
:
c0=strrchr(line,comment);
:
}

What can be the reason?

Thank you ;)))
Oct 23 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.