[flang-commits] [PATCH] D124449: [flang][docs] Update -fbackslash option for PGI compilers

Mike K via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Apr 27 09:50:56 PDT 2022


FruitClover updated this revision to Diff 425550.
FruitClover edited the summary of this revision.
FruitClover added a comment.

Fix typo


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124449/new/

https://reviews.llvm.org/D124449

Files:
  flang/docs/OptionComparison.md


Index: flang/docs/OptionComparison.md
===================================================================
--- flang/docs/OptionComparison.md
+++ flang/docs/OptionComparison.md
@@ -319,9 +319,9 @@
    </td>
    <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume bscc</a>
    </td>
-   <td>Mbackslash
+   <td><a href="https://docs.nvidia.com/hpc-sdk/compilers/hpc-compilers-ref-guide/index.html#cmdln-m-opts-fort-lang">Mnobackslash</a>
    </td>
-   <td>Mbackslash
+   <td>fbackslash
    </td>
   </tr>
   <tr>
@@ -1231,10 +1231,17 @@
 
 
 *   **GNU:** The "-fbackslash" option the interpretation of backslashes in string literals from a single backslash character to "C-style" escape characters. The following combinations are expanded \a, \b, \f, \n, \r, \t, \v, \\, and \0 to the ASCII characters alert, backspace, form feed, newline, carriage return, horizontal tab, vertical tab, backslash, and NUL, respectively. Additionally, \xnn, \unnnn and \Unnnnnnnn (where each n is a hexadecimal digit) are translated into the Unicode characters corresponding to the specified code points. All other combinations of a character preceded by \ are unexpanded.
+
+    **Note** that with -fbackslash \ interpretetation as \ (single backslash character) is a **GNU** extension (-std=gnu).
+
 *   **Intel:** The option "-assume bscc" tells the compiler to treat the backslash character (\) as a C-style control (escape) character syntax in character literals. "nobscc" specifies that the backslash character is treated as a normal character in character literals.  This is the default.
 
+*   **PGI:** -Mbackslash instructs the compiler to treat the backslash as a normal character, and not as an escape character in quoted strings. Default is -Mnobackslash.
+
 **"$" in symbol names:** Allowing "$" in names is controlled by an option in GNU and is the default behavior in IBM and Intel.  Presumably, these compilers issue warnings when standard conformance options are enabled.  Dollar signs in names don't seem to be allowed in Cray, PGI, or Flang.
 
+**Note** that **PGI** has different default option for escapes in literals (-Mnobackslash) compared to **GNU**/**Intel**.
+
 **<a name="do"></a>DO loop handling**
 
 **One trip:**


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124449.425550.patch
Type: text/x-patch
Size: 2280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220427/9851a491/attachment.bin>


More information about the flang-commits mailing list