English 中文(简体)
g++(gcc)或部族(llvm)[复制]禁止在线集会
原标题: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"

我如何执行这种禁止? 究竟有哪一种方式(如编造旗?) - 但我没有发现任何有用之处,只是搜索源代码中的短语?

我可以把人限制在++或部族。 正在对短链氯化石蜡进行处理。

问题回答

如何:

% gcc -Dasm=error -D__asm__=error

Looks like you re looking for the -fno-asm flag.

虽然它似乎只是<条码>sm,而不是照样<条码>__asm__<>>。 可在<代码>-D__asm__=something_该_will_error/上添加。

Also look at -fno-gnu-keywords for turning off asm in C++.





相关问题
gcc -fPIC seems to muck with optimization flags

Following along from this question: how-do-i-check-if-gcc-is-performing-tail-recursion-optimization, I noticed that using gcc with -fPIC seems to destroy this optimization. I am creating a shared ...

Generate assembler code from C file in linux

I would like to know how to generate assembler code from a C program using Unix. I tried the gcc: gcc -c file.c I also used firstly cpp and then try as but I m getting errors. I m trying to build an ...

Getting rid of pre-compiled headers

OK, I have old Metrowerks code for Mac and Windows where the previous developer used pre-compiled headers for every project that this code base builds. How does one get rid of Pre-compiled headers, ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

How to compile for Mac OS X 10.5

I d like to compile my application for version 10.5 and forward. Ever since I upgraded to Snow Leopard and installed the latest XCode, gcc defaults to 10.6. I ve tried -isysroot /Developer/SDKs/...