Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prohibit inline assembly in g++ (gcc) or clang (llvm) [duplicate]

There are problem-solving sites like topcoder.com, SPOJ. I'd like for similar use-case (people send me C++ program files) to do some restrictions.

One of those is:

  • "is not allowed using in-line assembly"

How can I enforce such prohibition? Is there smarter way (like compiler flags? - but I haven't found any useful) than just searching phrases in source-code ?

I can restrict people to g++ or clang. Things are being done on Linux.

like image 449
Grzegorz Wierzowiecki Avatar asked Jan 13 '12 09:01

Grzegorz Wierzowiecki


1 Answers

How about:

% gcc -Dasm=error -D__asm__=error
like image 125
Alnitak Avatar answered Nov 15 '22 12:11

Alnitak