#1 2022-12-20 08:13:07

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

enum without 0 as first cause c0000005

I use a enum in my soa objects
and was wondering why the client does not send the enum for Set Value 0 (This is default and optimized out from mORMot - i found out)
then i changed enum to start with 1

  TMyEnum = (
    vv1 = 1, // added = 1
    vv2,
    vv3
  );

This causes an Exception in mormot.core.rtti SetEnumType (line 3537)

This is not critical to me, i changed first value back to 0 - But just to think about.


Rad Studio 12.1 Santorini

Offline

#2 2022-12-20 08:31:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: enum without 0 as first cause c0000005

If the numbers are not starting with 0, then the RTTI is not aware of that.

It is a compiler restriction, which mORMot can't circumvent I am afraid.

Online

Board footer

Powered by FluxBB