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

Help with using _attribute_ ((unused))

I am trying to learn how to use the attribute unused so I created a little test program. Can you please tell me what is wrong? I get syntax errors "before attribute" and "before (" (sometimes).

Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2.  
  3. #define UNUSED _attribute_ ((unused))
  4.  
  5. void testUnused(int a UNUSED, int b);
  6.  
  7. int main()
  8. {
  9.   //testUnused(2, 5);  //i tried commenting this out, but still get syntax error
  10.   printf("hello\n");
  11. }
  12.  
  13. void testUnused(int a UNUSED, int b)
  14. {
  15.   printf("%d", b);
  16. }
  17.  
thanks!
Aug 7 '08 #1
1 4017
weaknessforcats
9,208 Expert Mod 8TB
Often a little Google goes a long way.

Read this and then look at your code: http://www.unixwiz.net/techtips/gnu-c-attributes.html.
Aug 8 '08 #2

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

Similar topics

2
by: Bernard Davest | last post by:
Does anybody know a tool that could help me finding unused functions on my VB applications? Thanks for your help. Bernard Davest
0
by: Donal | last post by:
I have the following: <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable> <xsl:attribute name='style'><xsl:value-of...
6
by: marktm | last post by:
Hi- I am trying to use setInterval to call a method within an object and have not had any luck. I get "Object doesn't support this property or method" when I execute the following code. What I...
5
by: Woon Kiat | last post by:
Hi, Using IDL, I can declare my enumeration like following, library MyAppLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); typedef enum MyColor
4
by: jsever05 | last post by:
I have created a class that communicates with an external program using a single socket connection. This socket connection is already thread-safe, so multiple requests to the socket can be made at...
4
by: Bob | last post by:
If two attribute instances of the same type have all their fields values identical, the compiler will say that they are not equal to each other, yet adding them both as keys in a hashtable will...
1
by: Phenglai | last post by:
I need a little help getting an attribute added to my XML Doc. I am trying to interface with the FedEx web site and they have this in the root: <FDXTrackResult...
1
by: Filip Hendrickx | last post by:
Hi there. I want to generate elements, choosing the element name dynamically. So I tried to use attribute value templates: <xsl:element name="{$local-name($someNode)}"> <!-- Generate element...
3
by: binary_sunset | last post by:
Okay... so this may be all to obvious to all except myself, but I am having some difficulty with XML output from Adobe InDesign. Each separate article in my publication is tagged as an article,...
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...
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...
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.