473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

warning: assignment makes pointer from integer without a cast

drhowarddrfine
7,435 Expert 4TB
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
10 9457
drhowarddrfine
7,435 Expert 4TB
Never mind. getvars() wasn't in my prototypes and that was the cause.
May 18 '07 #2
drhowarddrfine
7,435 Expert 4TB
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
7,435 Expert 4TB
Ok, I found out there was another include file I forgot to include and now it's solved.
May 19 '07 #4
Savage
1,764 Expert 1GB
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
1,251 Expert 1GB
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
JosAH
11,448 Expert 8TB
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
7,435 Expert 4TB
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
1,251 Expert 1GB
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
1,764 Expert 1GB
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
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

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

Similar topics

27
by: MK | last post by:
I am a newbie. Please help. The following warning is issued by gcc-3.2.2 compiler (pc Linux): ================================================================== read_raw_data.c:51: warning:...
16
by: David Ford | last post by:
I have a macro that I use across the board for freeing ram. I'd like to clean up my code so I don't get these warnings. #define sfree(x) _internal_sfree((void **)&x) #define _internal_sfree(x)...
4
by: Dawn Minnis | last post by:
Hi When I compile my files I get the following: driver.c: In function `main': driver.c:49: warning: assignment makes integer from pointer without a cast driver.c:50: warning: assignment...
16
by: jose_luis_fdez_diaz_news | last post by:
Hi, If I don't include <libgen.h> I get then warnig below in regcmp call: warning: improper pointer/integer combination: op "=" but if I include it the warning is not shown, but them program...
2
by: francescomoi | last post by:
Hi. I'm trying to compile this piece of source: ------------------------------------------- int id; while(row1 = mysql_fetch_row(rs1)) { id = atoi((int)row1);...
29
by: junky_fellow | last post by:
Consider the following piece of code: struct junk { int i_val; int i_val1; char c_val; }; int main(void) {
4
by: metalinc | last post by:
hi...im new to C programming...need help...tried to run this code but got this error fork.c: In function ‘parse’: fork.c:44: warning: comparison between pointer and integer fork.c:51: warning:...
3
by: mrmattborja | last post by:
Hello, Here is a program I'm playing around with for fun in the process of learning C. The objective is to create a function filesize() and call it from within the main() section to retrieve the...
1
by: woods1313drew | last post by:
The following code in c+ gives me the warning assignment makes integer from pointer without a cast. destination is set as char destination to limit the input string to 10 characters. name is an...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.