Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8066907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:08:09+00:00 2026-06-05T12:08:09+00:00

I am using the preprocessor of gcc to remove the comments from a verilog

  • 0

I am using the preprocessor of gcc to remove the comments from a verilog (.v) file (since the comment syntax is same as C/C++). I am using perl and hence used a shell command from my perl script

gcc -E $dest > $commentsrem

where $dest is my verilog file renamed as a .c file.
Since the preprocessor outputs data onto stdout, I redirected it to a file named $commentsrem .
Now the problem I face is that I get messages on the terminal saying

try.c:577: unterminated character constant

I guess this is because although in C you need to use ‘\’ to continue a statement on a new line, verilog has no such requirement. That is what it is reporting.

Now although in spite of these, it achieves what I want, it’s making the terminal messy. Any way to keep it quiet?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:08:11+00:00Added an answer on June 5, 2026 at 12:08 pm

    Redirecting standard error to the null device would silence all error output from the preprocessor. Not generally recommended, as you will not see genuine errors either.

    gcc -E $dest > $commentsrem 2> /dev/null
    

    The better way would be to filter known messages from the stderr by use of grep -v, so you would still see other error messages. For this, you need to redirect stderr to stdout, because piping doesn’t work on stderr:

    gcc -E $dest 2>&1 > $commentsrem | grep -v "unterminated character constant"
    

    The order of the redirections is important here. If you wrote > $commentsrem 2>&1, the error messages would end up in $commentsrem instead.

    For details on the redirecting, ref. this Q/A.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I print out the output of C preprocessor by using gcc -E a.c The
With using plain C preprocessor macros, is it possible to create something like: INIT_BASE(0x100)
In my jmeter test, I have a BSF PreProcessor step (using groovy) running before
I want to comment a line using the pre-processor: #define open /##* #define close
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using C++ preprocessor directives, is it possible to test if a preprocessor symbol has
I've generated a preprocessor out using the -E command. Is it possible to compile
I am trying to compile a sample c++ file test.cpp using IBM xlC compiler
In C Programming, We can enable/disable loop optimization using #pragma preprocessor directive. In which
I'm writing a preprocessor and postprocessor for Fortran input and output using FORMAT-like statements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.