compiler-options

Why doesn't {$ifopt FINITEFLOAT ON} compile?

a 夏天 提交于 2019-12-04 04:58:58
I have the construct: {$ifopt FINITEFLOAT ON} {$message 'FINITEFLOAT option ON' } {$else } {$message 'FINITEFLOAT option OFF' } {$endif } in my source and it won't compile! It's got to be something stupid. The error is: E1030 Invalid compiler directive: '$IFOPT' at the first line, but it is the FINITEFLOAT it's complaining about. You don't seem to be able to specify anything except the single letter directives like R+ etc as the argument of IFOPT. Am I missing something here? You are totally correct AFAICT. I don't use $IFOPT often but everytime I do this behaviour annoys me. I have no idea

How to see macro expansions step-by-step?

早过忘川 提交于 2019-12-04 03:04:05
问题 It seems Eclipse allows user to "see the expansion Step-by-Step" by pressing F2. I like this awesome feature. But can I do the same thing with just gcc or clang (or any tool)? -E option makes all macros fully expanded. So I haven't found any alternative way to expand macros step-by-step. Eclipse is big. I hope I don't need to install it everywhere and have it launched all the time. 回答1: It's a feature built into Eclipse. If such a tool was provided as part of the GCC or Clang toolchain,

Why do common C compilers include the source filename in the output?

穿精又带淫゛_ 提交于 2019-12-04 02:41:39
I have learnt from this recent answer that gcc and clang include the source filename somewhere in the binary as metadata, even when debugging is not enabled. I can't really understand why this should be a good idea. Besides the tiny privacy risks, this happens also when one optimizes for the size of the resulting binary ( -Os ), which looks inefficient. Why do the compilers include this information? cyphar The reason why GCC includes the filename is mainly for debugging purposes, because it allows a programmer to identify from which source file a given symbol comes from as (tersely) outlined

How can I set the language_in option for the Closure compiler?

流过昼夜 提交于 2019-12-03 15:15:00
问题 I need to set the language_in option on the Closure compiler to prevent the IE8 parse error: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option. I did find a post in the closure group relating to this, however, the option is set directly on the java compiler, rather than through one of the build scripts. I need to be able to set it on a build script. I'm

Automated F# Signature File (.fsi) Generation

感情迁移 提交于 2019-12-03 13:59:29
I am working on a project that has a number of modules that I'd like to apply access control constraints to. I'd also like to have my project contain additional documentation on the type signatures of each function. I know that I can accomplish both of these tasks very easily via F# signature files. However, my project is large and contains many files, and I need a convenient way of generating a signature file for each one. I have been successful in generating individual signature files via command line compilations using the --sig compiler option , but I am stuck on how to add compiler

Adjust Variable Tracking Assignment Length

陌路散爱 提交于 2019-12-03 09:47:39
In a release build I'm getting the following informational warning from GCC 4.4.7. note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without Have I exceeded the variable name length supported by variable tracking assignment? If so, is there a way to adjust the supported size? This is just a note from the compiler that the debug info for the particular function will have lower quality, because your code of function is too large/complex so variable tracking reached limit of hash table slots. The max is likely lot of millions and it can be raised with something

How can I set the language_in option for the Closure compiler?

廉价感情. 提交于 2019-12-03 05:49:26
I need to set the language_in option on the Closure compiler to prevent the IE8 parse error: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option. I did find a post in the closure group relating to this, however, the option is set directly on the java compiler, rather than through one of the build scripts. I need to be able to set it on a build script. I'm looking at the scripts in closure/bin/build/ and there are several there. I tried adding the option to

C#: Benefit of explicitly stating “unsafe” / compiler option

…衆ロ難τιáo~ 提交于 2019-12-01 03:58:11
I understand pointers and the rare need to use them in C# code. My question is: what is the reasoning behind having to explicitly state "unsafe" in a block of code. Additionally, why must a compiler option be changed to allow "unsafe" code? Bottom Line: What in the CLR (or language specs) makes it so we can't just use pointers whenever we want (much like C and C++) without having to type "unsafe" and change the compiler option? For clarification: I know what "unsafe" and "safe" code is. It's just a question of why must we do all the extra work (ok, not THAT much extra) just to be able to use

C#: Benefit of explicitly stating “unsafe” / compiler option

风格不统一 提交于 2019-12-01 00:58:15
问题 I understand pointers and the rare need to use them in C# code. My question is: what is the reasoning behind having to explicitly state "unsafe" in a block of code. Additionally, why must a compiler option be changed to allow "unsafe" code? Bottom Line: What in the CLR (or language specs) makes it so we can't just use pointers whenever we want (much like C and C++) without having to type "unsafe" and change the compiler option? For clarification: I know what "unsafe" and "safe" code is. It's

GCC pragma to add/remove compiler options in a source file

孤街醉人 提交于 2019-11-30 23:20:04
问题 I have developed a cross-platform library which makes fair use of type-punning in socket communications. This library is already being used in a number of projects, some of which I may not be aware of. Using this library incorrectly can result in dangerously Undefined Behavior. I would like to ensure to the best of my ability that this library is being used properly. Aside from documentation of course, under G++ the best way I'm aware of to do that is to use the -fstrict_aliasing and -Wstrict