[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] gcc-warning: SOLVED!



Hello all there,

In fact, the shortened code I gave you was correct. What was missing in
the original code was #include "bet.h" in main.c, so the prototype for
this function was indeed missing for main, as many of you said. 
I might have come across it in the further development of the program, but
with your help, I could solve the problem really fast, so thanks very much
to all who answered.
Regards,
Daniel

On Wed, 18 Oct 2000, Daniel Reuter wrote:

> Hello there, 
> 
> Thanks to all, who responded up to now. I think I'll give some more
> information, as I still don't understand, why the warning 
> main.c:158: assignment makes pointer from integer without a cast
> is generated in my case:
> 
> I have the following (among some other function and structure 
> declarations) in my program-header-file 'bet.h':
> 
> 	#include <stdlib.h>
> 	#include <stdio.h>
> 
> 	struct provided_data{
> 		double sample_weight;
> 		struct datapoint *ppovolads;
> 		int value_count;
> 	};
> 
> 	struct provided_data *read_data(char *);
> 
> 
> This function is in file 'scanner.c' and does the following:
> 
> 	#include "bet.h"
> 
> 	struct provided_data *read_data(char *input_file_name)
> 	{
> 		struct provided_data *prov_data_buffer;
> 		
> 		Read in some data and put them into structure provided_data.
> 		Then return pointer to structure provided data using the
> 		following statement:
> 		
> 		return(prov_data_buffer);
> 	}
> 
> 
> In file main.c I have the following:
> 
> 	#include "bet.h"
> 
> 	int main(int argc, char **argv)
> 	{
> 		some code that reads commandline opts and so on.
> 		
> 		Here I define input_data:
> 		struct provided_data *input_data;
> 		
> 		Now call read_data:
> --->		input_data=read_data(input_file_name);
> 	}
> 
> line marked with ---> is the line, the compiler complains about.
> I don't quite understand this, because I never declared function read_data
> to return an int. Is something wrong with my function declaration?
> Regards,
> Daniel




Reply to: