Search notes:

gcc -C / -CC

With -C or -CC, the preprocessor is instructed to keep the comments.
This is demonstrated with the following little program:
// This is a comment

/* Here's another comment */

#define NUM 42 // This C++ Style comment is converted to a C style comments with -CC. With -C, it's removed.

int returnValue() {
  return NUM;
}

int main() {
  return returnValue();
}
Github repository about-gcc, path: /options/C_/prog.c

Compiling with -P -E

When the source file is compiled with -P -E, it produces
int returnValue() {
  return 42;
}
int main() {
  return returnValue();
}
Github repository about-gcc, path: /options/C_/flag_none.i

Also using -C

With the -C option added, gcc produces:
// This is a comment
/* Here's another comment */
int returnValue() {
  return 42;
}
int main() {
  return returnValue();
}
Github repository about-gcc, path: /options/C_/flag_C.i

Using -CC

With the -CC option (instead the -C option), gcc produces:
// This is a comment
/* Here's another comment */
int returnValue() {
  return 42 /* This C++ Style comment is converted to a C style comments with -CC. With -C, it's removed.*/;
}
int main() {
  return returnValue();
}
Github repository about-gcc, path: /options/C_/flag_CC.i

See also

GCC options

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759390314, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/C-C-plus-plus/GCC/options/C_(93): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78