Erroneous compiler directives lazarus / 62-General ---------------------------------------------------------------------- Pasqualish · 2016-07-06 05:50 This program Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program test_modes;{$mode bogus}{$bogus } begin end. compiles without error or warning on FPC 3.0.0 and 2.6.2. The documentation seems to say that  there will never be an error (what I would prefer), but in this case, I am not getting a warning, even though the documentation does mention warnings: QuoteThe fact that a directive is specified as a comment means that it is not a pascal instruction. That in turn means that if a non-existing directive is specified, the compiler does not give an error, it just gives a warning about an invalid/unknown directive. ---------------------------------------------------------------------- Thaddy · 2016-07-06 06:36 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pi@raspberrypi:~ $ fpc -vwenh test_modestest_modes.pas(2,2) Warning: Illegal compiler switch "BOGUS"test_modes.pas(3,2) Warning: Illegal compiler directive "$BOGUS"  You have to specify it, but the warnings are there.... -vwenh means : be verbose and show me warnings, errors, notes and hints. Alternatively you can do this:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pi@raspberrypi:~ $ fpc -Sew test_modestest_modes.pas(3,2) Warning: Illegal compiler switch "BOGUS"test_modes.pas(4,2) Warning: Illegal compiler directive "$BOGUS"test_modes.pas(9) Fatal: There were 2 errors compiling module, stoppingFatal: Compilation abortedError: /usr/local/bin/ppcarm returned an error exitcode  -Sew means: treat warnings as errors. As you can see, the code won't even compile. Ergo: this is perfectly ok. ---------------------------------------------------------------------- Pasqualish · 2016-07-06 08:22 Quote from: Thaddy on July 06, 2016, 08:36:26 am-vwenh means : be verbose and show me warnings, errors, notes and hints. -Sew means: treat warnings as errors. Thanks! Just what I was looking for. ---------------------------------------------------------------------- Thaddy · 2016-07-06 09:02 Just put it in your fpc.cfg under DEBUG mode and you are done. ---------------------------------------------------------------------- Pasqualish · 2016-07-06 09:35 Quote from: Thaddy on July 06, 2016, 11:02:26 amJust put it in your fpc.cfg under DEBUG mode and you are done. What is the syntax for DEBUG mode in fpc.cfg?  Also, does fpc.cfg a comment syntax? ---------------------------------------------------------------------- Thaddy · 2016-07-06 09:59 Quote from: Pasqualish on July 06, 2016, 11:35:31 amQuote from: Thaddy on July 06, 2016, 11:02:26 amJust put it in your fpc.cfg under DEBUG mode and you are done. What is the syntax for DEBUG mode in fpc.cfg?  Also, does fpc.cfg a comment syntax? if you would use a standard install. or make a template with fpcmkcfg You will obtain a file named fpc.cfg that you can edit to contain your own preferences. Read the documentation. It is excellent. After (editing) that you can simply specify -dDEBUG or -dRELEASE And yes, fpc.cfg has a commenting syntax Figure it out... There's no rocket science involved, just reading documentation. ---------------------------------------------------------------------- Pasqualish · 2016-07-07 08:03 Quote from: Thaddy on July 06, 2016, 11:59:29 amAnd yes, fpc.cfg has a commenting syntax Figure it out... There's no rocket science involved, just reading documentation. I had already read the online documentation for the configuration file , in the User's Guide, and it said nothing about comments and nothing about a DEBUG mode. After your last erroneous claim that the online documentation talked about {$mode DelphiUnicode} I have to wonder if you are taking your own advice. ---------------------------------------------------------------------- Thaddy · 2016-07-07 08:18 Quote from: Pasqualish on July 07, 2016, 10:03:48 amQuote from: Thaddy on July 06, 2016, 11:59:29 amAnd yes, fpc.cfg has a commenting syntax Figure it out... There's no rocket science involved, just reading documentation. I had already read the online documentation for the configuration file , in the User's Guide, and it said nothing about comments and nothing about a DEBUG mode. After your last erroneous claim that the online documentation talked about {$mode DelphiUnicode} I have to wonder if you are taking your own advice. You do have a problem if you did not read this: http://wiki.freepascal .org/FPC_New_Features_3.0#New_delphiunicode_syntax_mode The commenting syntax for fpc.cfg is a # So: next time do better. If you generate the docs from source the mode is documented for trunk, btw. Sometimes the online docs under documentation lag a bit behind. But release notes and new features are part of the documentation as per the provided link. ---------------------------------------------------------------------- Pasqualish · 2016-07-07 09:19 Quote from: Thaddy on July 07, 2016, 10:18:29 amYou do have a problem if you did not read this: http://wiki.freepascal.org/FPC_New_Features_ 3.0#New_delphiunicode_syntax_mode So: next time do better. If you generate the docs from source the mode is documented for trunk, btw. But release notes and new features are part of the documentation as per the provided link. I do have a problem if the current online documentation doesn't reflect what is a part of the compiler. Since the wiki has more current information than the documentation, they should consider moving the documentation into the wiki or putting links from the documentation back to the wiki, where presumably information can be updated by more people and quickly. QuoteSometimes the online docs under documentation lag a bit behind. Apology accepted. QuoteThe commenting syntax for fpc.cfg is a # Good to know. ---------------------------------------------------------------------- Thaddy · 2016-07-07 09:27 - Facts are not apologies...  - Online documentation - including release notes - are generally considered as documentation. Just like with the compiler itself: If you want to use trunk in all its glory, don't forget to generate the documentation that goes with it. Or, maybe warranted, file a bug report against this issue of missing information in the - in this case - Programmer's Guide for version 3.0.0. Mind you: you have a point, but it IS documented. BTW: trust the docs, not the wiki. It's a wiki: helpful but in very many cases misleading or out-of-date. Michael guards very carefully over the official documentation but has very little if anything to do with the wiki. And that is a good thing.