473,412 Members | 3,471 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,412 software developers and data experts.

best way to ignore a function? maybe using #pragma?

Hello - Is there a pragma directive that will make a function be ignored? I have a function that is not currently being used and it creates a warning. I would like to fix the warning by using pragma, if possible but all I have tried isn't working...

for example i tried:
#pragma function(myFunct) //didn't work

If pragma won't work - what is the best trick to have the compiler "ignore" a function that's not being used?

thanks!
Jul 29 '08 #1
4 2348
JosAH
11,448 Expert 8TB
If your function definition and declaration is out of the way, simply do this:

Expand|Select|Wrap|Line Numbers
  1. #define your_function(dummy, params, here)
  2.  
This removes all the function calls from the rest of your code.

kind regards,

Jos
Jul 29 '08 #2
If your function definition and declaration is out of the way, simply do this:

Expand|Select|Wrap|Line Numbers
  1. #define your_function(dummy, params, here)
  2.  
This removes all the function calls from the rest of your code.

kind regards,

Jos
Sorry, but I get an error after I try that, because one of my parameters is a pointer...here is kinda of what i have...
Expand|Select|Wrap|Line Numbers
  1. static void setCount( inst *countPtr, int loopCount) {
  2.   *countPtr = (loopCount);
  3. }
  4.  
i have also tried something called _attribute_ ((unused)) that didn't work.
please advise...thanks!
Jul 29 '08 #3
Not sure if this will work for what you need, but could you comment it out?
Jul 29 '08 #4
JosAH
11,448 Expert 8TB
Sorry, but I get an error after I try that, because one of my parameters is a pointer...here is kinda of what i have...
Expand|Select|Wrap|Line Numbers
  1. static void setCount( inst *countPtr, int loopCount) {
  2.   *countPtr = (loopCount);
  3. }
  4.  
i have also tried something called _attribute_ ((unused)) that didn't work.
please advise...thanks!
Didn't you read what I wrote? Get that definition out of the way then my
suggestion works fine. Simply comment out that definition as well.

kind regards,

Jos
Jul 29 '08 #5

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

Similar topics

1
by: BCC | last post by:
Hi, This is kind of a followup to a previous question... I have a container class that has a load of variables (~100). For example, I have groupings like this: class CContainer {...
131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
4
by: Chuck Ritzke | last post by:
I keep asking myself this question as I write class modules. What's the best/smartest/most efficient way to send a large object back and forth to a class module? For example, say I have a data...
4
by: Adriano Coser | last post by:
I'm getting the following error: error C3767: PictureSource - candidate function(s) not accessible when accessing a public member function of a managed class, either from managed or unmanaged...
1
by: H.B. | last post by:
Hi, I need to make a function that can display data on my Managed C++ app and be called by an unmanaged C++ DLL. Something like : void Form1::Form1_Load(System::Object * sender,...
55
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some...
3
by: Russell | last post by:
Hey, ok i have numerous tables to search through for a 'site search'. some of the searchble fields have html embeded within so after some quick referencing, saw I can use the regExp function...
41
by: Jim | last post by:
Hi guys, I have an object which represents an "item" in a CMS "component" where an "item" in the most basic form just a field, and a "component" is effectively a table. "item" objects can be...
32
by: David Mark | last post by:
I've got a collection of functions that accept a function or object (paired with a method name) as a callback. For the longest time I have relied on this test. (typeof cb == 'function') ...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.