warning C6334: sizeof operator applied to an expression with an operator might yield unexpected results
Code: Select all
void gdt::initialize()
{
// Initialize Pointer
sm_pointer.limit = (sizeof(DESCRIPTOR) * GDT_MAX_DESCRIPTORS) - 1;
sm_pointer.base = (uint32_t)(sm_table);
// Initialize Table
memset(sm_table, 0, sizeof((sizeof(DESCRIPTOR) * GDT_MAX_DESCRIPTORS)));
}
I don't know how I ever would of found that typo. I probably wouldn't have come back and looked over my GDT code for awhile yet. Needless to say, Code Analysis is now on for all my projects. I haven't been this impressed with an IDE since I first started using one.