473,385 Members | 1,387 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,385 software developers and data experts.

C4047 warning (passing/return addresses)

Hello

got two warning when compiling , the .exe file works fine with these warning but i prefer to get rid of them :) if anyone can point me to a general website for indirection warnings that would be nice because i don't know anything about them or a fix with a simple explanation


Thanks
Sam

USAGE
*Code to calculate boolean product of two unknown square matrix sizes

WARNINGS:
boolean.c(13) : warning C4047: '=' : 'int *' differs in levels of indirection fr
om 'int'
boolean.c(46) : warning C4047: 'return' : 'int' differs in levels of indirection
from 'int *'

CODE(part of it)
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. //PROTOTYPES
  4. int boolean_mproduct(int *xptr , int *yptr , int s); 
  5.  
  6.  
  7.  
  8. //MAIN
  9. void main(void)
  10. {
  11. ........................
  12. ........................
  13. int *zptr;
  14. zptr = boolean_mproduct(&x[0][0],&y[0][0],s); //line 13
  15. .......................
  16. }
  17.  
  18.  
  19.  
  20. //FUNCTION
  21. int boolean_mproduct(int *xptr , int *yptr , int s)
  22.  
  23. {
  24. int *zptr;
  25. zptr = (int *)malloc(s*s*sizeof(int));
  26. .......................................
  27. .......................................
  28. return zptr; //line 46
  29. }
  30.  
Aug 8 '07 #1
4 2488
JosAH
11,448 Expert 8TB
I'm afraid you dotted out the lines that caused the warning message. What's left
to view makes sense though.

kind regards,

Jos
Aug 8 '07 #2
oh sorry for the dotted parts , was just following posting guidelines :(
i will PM the full code or send in any other way you prefer to anyone willing to help

Thanks
Sam
Aug 8 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
Your error is here:

int boolean_mproduct(int *xptr , int *yptr , int s)

{
int *zptr;
zptr = (int *)malloc(s*s*sizeof(int));
.......................................
.......................................
return zptr; //line 46
}
The function boolean_mproduct() returns an int but you are returning an int*. I'm surpsrised your compiler lets this go by with a warning. This type of error should stop the build.
Aug 8 '07 #4
Your error is here:



The function boolean_mproduct() returns an int but you are returning an int*. I'm surpsrised your compiler lets this go by with a warning. This type of error should stop the build.
yea , it was just a warning

using
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
included in Microsoft Visual C++ 2005 Express edition


Thanks a lot , worked
Aug 8 '07 #5

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

Similar topics

12
by: Fred Pacquier | last post by:
First off, sorry for this message-in-a-bottle-like post... I haven't been able to phrase my questions well enough to get a meaningful answer from Google in my research. OTOH, it is standard...
1
by: Derek | last post by:
I get the following warning warning C4355: 'this' : used in base member initializer list when I compile the following program with VC6 and VC7 (the latest GCC and Comeau doesn't think anything...
6
by: Ken Post | last post by:
Hi All: I've read a whole slew of posts about creating temp tables using stored proceedures to get the crosstab ability, but I'm wondering if, for this specific case, there might be a more...
10
by: isxyos | last post by:
Hello, It's just a warning, but can anybody explain to me what this warning is: warning C4047: '=' : 'unsigned int ' differs in levels of indirection from 'void *' #include <stdio.h> void...
5
by: pkirk25 | last post by:
I like to keep warnings to a minimum and am find this one cropping up a lot. struct auction_bargains bargainList; struct auction_bargains *pBargainList = &bargainList; I am creating an array...
6
by: subramanian | last post by:
Consider the following program: #include <stdio.h> void myfn(const int **a) { static int i, j, k; a = &i; a = &j;
5
by: Martin Herbert Dietze | last post by:
Hello, consider this code: | /* warning613.c */ | #include <assert.h> | #include <string.h> | | size_t | myStrLen(char const* s)
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...
2
by: mullhead | last post by:
This warning keeps popping up... box.c(50) : warning C4047: '=' : 'box *' differs in levels of indirection from 'size_t' 49 pBox = malloc(sizeof(box)*lineCount-1); 50 assert(pBox =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.