|
|
Choosing A Webhost: |
Re: Problems with -Wall flag: msg#00015search.snowball
On Tue, Feb 24, 2004 at 05:54:27PM -0700, Neal Richter wrote: > Is this a thank you for the polite input? I apologise if perhaps overly terse response came across as rude. That wasn't my intention at all. > 10 of the 14 errors reported were not machine generated. And should obviously be corrected! > I made no claim for coding standards for machine-generated code. In > general, enforcing any kind of style on this type of code is silly and > fairly hard. Sorry, I read your message as saying these warnings were a problem for you because of the coding standards. > Correctness is the only real metric, and efficiency is a consideration. > > Note that the 'unused variable m' error at a minimum results in several > meaningless machine instructions. Keeping track of when/if it is used is > hard, so I have no problem if you want to ignore it. I'd hope any decent compiler would remove such dead code (and if it can warn about it, it must know it's dead code!) GCC does remove such code if you enable optimisation - identical code is produced for functions foo and bar: $ cat test.c void foo(int a, int b) { int m = a - b; } void bar(int a, int b) { } $ gcc-2.95 -O -S -Wall test.c .file "test.c" .version "01.01" gcc2_compiled.: .text .align 4 .globl foo .type foo,@function foo: pushl %ebp movl %esp,%ebp leave ret .Lfe1: .size foo,.Lfe1-foo .align 4 .globl bar .type bar,@function bar: pushl %ebp movl %esp,%ebp leave ret .Lfe2: .size bar,.Lfe2-bar .ident "GCC: (GNU) 2.95.4 20011002 (Debian prerelease)" > Thanks for all your hard work on Snowball. I'm mostly a user. Most of the hard work is done by Martin and Richard. Cheers, Olly
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Problems with -Wall flag, Neal Richter |
|---|---|
| Next by Date: | Re: Problems with -Wall flag, Martin Porter |
| Previous by Thread: | Re: Problems with -Wall flag, Neal Richter |
| Next by Thread: | Re: Problems with -Wall flag, Martin Porter |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |