Opened 2 months ago

Closed 5 weeks ago

#81 closed defect (wontfix)

dioscc and divine cc explicitly undefine the __x64_86__ macro

Reported by: Lukáš Zaoral Owned by: blurrymoi
Priority: major Milestone: 4.3
Component: divcc Keywords:
Cc: kdudka@…, jamartis@…, lzaoral@…

Description

Hello, the following code is preprocessed differently than with other compilers (e.g. divcc (fixed in #76), clang, ...) when using dioscc or divine cc, therefore, Divine 4.3.6 gives a wrong verification result.

#include <stdio.h>

int main(void) {
    puts("Expecting a NULL pointer dereference...");
#ifdef __x86_64__
    int* a = NULL; 
    return *a;
#else
    puts("... and nothing happened.");
#endif
}

The __x68_64__ and __x86_64 macros are explicitly undefined in the "divine/rt/dios-cc.cpp" file. If this is an expected behaviour, could you please provide the reason for such decision? Thank you.

Change History (1)

comment:1 Changed 5 weeks ago by mornfall

Resolution: wontfix
Status: newclosed

We have discussed this in IRC, but the gist is: DiOS running on DiVM is not x86-64 and therefore should not set this macro. Checking architecture-specific code will need special precautions in either case: it is correct and expected that code uses this and related macros to guard inline assembly and other CPU-specific code which we can't correctly execute anyway (at least for the time being).

Note: See TracTickets for help on using tickets.