[LLVMdev] Jumping to a fixed address in Clang (original) (raw)
David Meyer pdox at google.com
Fri Sep 16 17:37:40 PDT 2011
- Previous message: [LLVMdev] Announcing: LLVM 3.0 Tentative Schedule
- Next message: [LLVMdev] Jumping to a fixed address in Clang
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I am compiling some code with Clang which needs to jump to a fixed address to perform a "syscall". These fixed addresses contain valid code.
I noticed that this code produces a warning:
typedef void (*exit_syscall_type) (int status) attribute((noreturn)); void _exit(int status) attribute ((noreturn)); void _exit(int status) { ((exit_syscall_type)0x10000)(status); }
This (seemingly equivalent) code does not:
typedef void (*exit_syscall_type) (int status) attribute((noreturn)); void _exit(int status) attribute ((noreturn)); void _exit(int status) { exit_syscall_type ptr = (exit_syscall_type)0x10000; ptr(status); }
The warning produced is:
warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
Is this discrepancy intentional?
- David Meyer
- Previous message: [LLVMdev] Announcing: LLVM 3.0 Tentative Schedule
- Next message: [LLVMdev] Jumping to a fixed address in Clang
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]