From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: __attribute__((unused)) ... does it really work? Date: Wed, 03 Mar 1999 13:19:30 -0400 Organization: BrunNet Lines: 30 Message-ID: <36DD6F21.3E62568E@unb.ca> NNTP-Posting-Host: ftnts3c47.brunnet.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I can't seem to get the __attribute__((unused)) variable attribute to work. I'm using gcc v2.8.1, and this is the command-line I used to compile, I have also listed the output from gcc and the file "t.cc". gcc says it's ignoring the attribute, then it gives me a warning about the variable not being used??? [which is what the attribute is supposed to stop] gcc -W -Wall -Wunused -o t.exe t.cc -------------------------------------------------- t.cc:1: warning: `unused' attribute ignored t.cc: In function `int aaaa(int)': t.cc:2: warning: unused parameter `int a' ------------------------------------------------ int aaaa(int __attribute__((unused)) a) { return 7; } int main() { return 0; } -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlisnis AT BrunNet DOT Net Endlisnis AT HotMail DOT com