473,385 Members | 1,185 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.

warning: statement has no effect

Hello - I am trying to eliminate warnings in my code...and have a question...

I have a function
Expand|Select|Wrap|Line Numbers
  1. void function_name(void)
  2. {
  3.   functionA();
  4. }
  5.  
which goes to a file that says:

Expand|Select|Wrap|Line Numbers
  1.  
  2. #define functionA()   functionB()
  3.  
which finally goes to:

Expand|Select|Wrap|Line Numbers
  1. #define functionB() (0)
  2.  
I need to keep these macro definitions there, but it obviously doesn't do anything right now. What can I put in this code to supress that warning??

Thanks!
Jul 18 '08 #1
4 18376
Banfa
9,065 Expert Mod 8TB
Well you could put in a ; instead of (0) but then you couldn't use functionA in an expression. It partly depends on what the nominal return type of functionA is supposed to be.
Jul 18 '08 #2
Thanks for the response... I tried putting a ; instead of (0) but the warning did not go away. What can I do?

Thanks!
Jul 18 '08 #3
oler1s
671 Expert 512MB
In Visual C++, for example, I would have followed the advice at http://msdn.microsoft.com/en-us/library/2c8f766e.aspx. (Specifically, I would have used the push/pop mechanism indicated at the bottom of the page.)

It depends on the compiler to try and disable the warning.
Jul 18 '08 #4
JosAH
11,448 Expert 8TB
Most (if not all) compilers keep their mouth shut if a value is cast to a void; as in:

Expand|Select|Wrap|Line Numbers
  1. (void)functionA();
  2.  
kind regards,

Jos
Jul 18 '08 #5

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

Similar topics

1
by: Campano, Troy | last post by:
Do you know what I did wrong? I'm trying to enable some logging features in postgresql.conf, but now I get this message when I try to connect to the postgresql server... WARNING: ...
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
10
by: Rich Sienkiewicz | last post by:
The C# compiler gives warnings about unused variables. I thin it needs a warning about an unassigned reference. For instance, this compiles without any warnings/errors, but of course blows up when...
12
by: Pawel | last post by:
Hallo group members Could You tell hw to write this code in order not to get warning from subject: #include <iostream> using namespace std; using namespace __gnu_cxx; struct entry {
5
by: onkar | last post by:
#include<stdio.h> int main(void){ unsigned int m=0xfdff; ~m; printf("%x\n",m); return 0; } gives me :
7
by: Nevil Lesdog | last post by:
What do you think is the best way to handle a compiler warning about comparing an unsinged value to a singed value? Cast to silence it? Disable that warning altogether? Or just live with it? On...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
2
by: Speaker | last post by:
I am receiving a few errors when I try to run my program and I can't figure out what I am doing wrong. I'm coding in C++ with minGW on Vista SP1. Here is my code: #include <iostream> using...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.