Skip to content

Releases: jleffler/scc-snapshots

Pre-release 6.16 of SCC dated 2016-01-19

19 Jan 05:12
Compare
Choose a tag to compare

More major rewriting — adding some support for some of the features of C++11 and C++14.

Usage: scc [-cfhntwV][-S std][-s rep][-q rep] [file ...]

Options:

  • -c — Print comments and not the code
  • -f — Print flags in effect (debugging mainly)
  • -h — Print this help and exit
  • -n — Keep newlines in comments
  • -s rep — Replace the body of string literals with rep (a single character)
  • -q rep — Replace the body of character literals with rep (a single character)
  • -t — Recognize trigraphs
  • -w — Warn about nested C-style comments
  • -S std — Specify language standard (C, C++, C89, C90, C99, C11, C++98, C++03, C++11, C++14; default C11)
  • -V — Print version information and exit

Note that the trigraphs option was a transient step; it was removed subsequently. Trigraphs are theoretically important to comment removal because ??/ maps to \ and this can affect the interpretation of comments. Subsequently, it was decided that trigraphs should be handled separately; there is a program called trigraphs (and another called digraphs) to handle the addition or removal of trigraphs.

The C++ standards added some complicating factors. Raw strings aren't handled fully in this version (despite any claims to the contrary). However, numeric punctuation (0x7FFF'23A0'916C'3140, for example) is handled (it must be; that isn't a multi-character constant in the middle) and binary literals (0b0011'1010'0000'0011, for example) are handled too. So too are extended identifiers using the \u2213 and \U0001F600 Unicode characters.

The manual page (scc.1) is out of date.