Article # 293, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
My fatal errors aren't seen in Swat.
Q. I get the following warning in swat when I'm stepping through EC_ERROR_IF() when the failcase is true: 628: EC_ERROR_IF( tempLogFileH == NullHandle, SAMPLE_TEMP_LOG_FILE_NOT_CREATED ); Warning: brk2: error: not a valid type Stepping in /staff/pcgeos/Library/Kernel/Boot/bootBoot.asm... 878: push bp, si, ds, ax This is how I've set up this FatalError: typedef enum {SAMPLE_TEMP_LOG_FILE_NOT_CREATED, /* the handle of the log file is Null when it shouldn't be */ } FatalErrors; What am I doing wrong? A. You need to declare a fake global variable of type FatalErrors in GOC, in order for your FatalErrors to fold in properly with the system-defined FatalErrors. (You don't need to do this in assembly). Here's more on why this is the case: InteractionCommand is a type that's actually defined in a .h or .goh file. FatalErrors isn't (it's unique to the geode being created, and thus always begins at 0). The FatalErrors enum is one of these things that's actually really cool, but few people really understand it. The number of times people have defined FatalErrors members in global .def files is amazing. In essence, there are multiple FatalErrors enumerated types, one defined by each geode. Swat determines in which FatalErrors enumerated type to look up an error code by seeing which geode owns the routine that called FatalError. It's really quite simple. This behaviour is why it's pointless to define fatal error codes in a .def file in Include: unless the code that's including the .def file is going to be generating those error codes, there's no point in having them defined.