LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-19-2007, 10:14 AM   #1
chandru.in
Member
 
Registered: Jun 2005
Posts: 167

Rep: Reputation: 30
Unhappy How to remove decoration characters from GCC output?


Hi,

After quite a few years I tried to program in C using gcc. In older version there were no decoration characters in between error messages. Now I tried it on Kubuntu Gutsy Gibbon. I find that the error messages contain non-ASCII characters in betweem.

When I use gcc to compile within Emacs these characters make it difficult to read the actual error message. How do I remove these decorations from gcc output? If not, is there a way to make Emacs display them properly?
 
Old 11-19-2007, 11:49 AM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
It all depends on your locale. Here is the result of an experiment (bold text is text I typed, non-bold is output):
Code:
$ echo 'int main() { return bar; }' > foo.c
$ LC_ALL=en_US.UTF-8 make foo
cc     foo.c   -o foo
foo.c: In function ‘main’:
foo.c:1: error: ‘bar’ undeclared (first use in this function)
foo.c:1: error: (Each undeclared identifier is reported only once
foo.c:1: error: for each function it appears in.)
make: *** [foo] Error 1
$ LC_ALL=en_US make foo
cc     foo.c   -o foo
foo.c: In function 'main':
foo.c:1: error: 'bar' undeclared (first use in this function)
foo.c:1: error: (Each undeclared identifier is reported only once
foo.c:1: error: for each function it appears in.)
make: *** [foo] Error 1
Notice that in the first, the single quotes are actual unicode quote marks (‘’). In the second, they are the ASCII straight quotes ('').

As for getting Emacs to display them properly, I can’t help you there, though I’m sure it’s possible (I am a vi man myself .
 
Old 11-27-2007, 09:39 PM   #3
chandru.in
Member
 
Registered: Jun 2005
Posts: 167

Original Poster
Rep: Reputation: 30
Thanks! That worked.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SED - remove last four characters from string 3saul Linux - Software 12 01-16-2023 10:21 AM
Need to remove the first three characters in the name of a ton of files... ooagentbender Linux - Newbie 17 10-04-2013 02:02 PM
sed question: remove decoration from each line Hivemind Linux - Software 1 01-18-2006 07:13 AM
remove characters in c alaios Programming 2 07-10-2005 10:10 AM
C: Weird characters on output notsoevil Programming 3 06-23-2003 04:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration