This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Dividing by zero does NOT generate exception
On 2011-03-04, Quanren Xiong <xiongqr@gmail.com> wrote:
> I am using ECOS 2.0.33. To my suprise, the following code does NOT
> generate an exception.
>
> "int b=1; int c=b/0;" The value in variable c will be 0.
>
> The platform is at91rm9200. I double and triple checked the following
> options are on:
>
> CYGSEM_KERNEL_EXCEPTIONS_GLOBAL,
> CYGPKG_HAL_EXCEPTIONS,
> CYGPKG_KERNEL_EXCEPTIONS.
>
> And CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS is disabled.
>
> I would like an exception being generated.
Sorry.
Exceptions are run-time events triggered by code that is executing on
the target.
That snippet _doesn't_generate_any_executable_code_.
> What am I doing wrong?
You're expecting a run-time exception from something that doesn't
actually execute at runtime.
--
Grant Edwards grant.b.edwards Yow! Kids, don't gross me
at off ... "Adventures with
gmail.com MENTAL HYGIENE" can be
carried too FAR!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss