Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / September 2004



Tip: Looking for answers? Try searching our database.

division by 0 error at compile time?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen Chu - 27 Sep 2004 19:09 GMT
Warning : division by 0
HelloWorld.cp line 36   }

I probably should file a bug report but want to ask here first to make
sure it's not me.

I just upgraded to 9.3 and run into this error when compiling with
global optimization level 4:

Warning : division by 0
XXX.cp line XX   }

The code is:

const int kBase = 96;

char *
Get96BaseString(
  int      inValue,
  char *   ioBuf,
  int      inLen)
{
  int n = inValue;
  for(int i=inLen-1;i>=0;--i) {
     ioBuf[i] = n % kBase + ' ';
     n /= kBase;
  }
  return ioBuf;
} <--- error points here

The erro will go away when lowering the optimization level to 2 or
change kBase to any number other than 96.

Any clue?
MW Ron - 27 Sep 2004 21:04 GMT
>Warning : division by 0
>HelloWorld.cp line 36   }
>
>I probably should file a bug report but want to ask here first to make
>sure it's not me.

It isn't you,  it is a bug,  I'll report it but it would be better if
you reported it too.

Ron

>I just upgraded to 9.3 and run into this error when compiling with
>global optimization level 4:
[quoted text clipped - 24 lines]
>
>Any clue?

Signature

Metrowerks Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and Metrowerks' staff
       --   http://www.metrowerks.com/community  --

Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.