SCIENTIFIC-LINUX-USERS Archives

April 2009

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Tue, 7 Apr 2009 13:35:39 -0700
Content-Type:
multipart/mixed
Parts/Attachments:
TEXT/PLAIN (2284 bytes)
On Tue, 7 Apr 2009, Peter Elmer wrote:

>  Hi Matthew,
>
> On Tue, Apr 07, 2009 at 03:05:10PM -0500, Matthew Jones wrote:
>> I recently installed SL5.2, which generally works well, but gcc is unable
>>  to
>> report the symbols that it is having difficulty compiling...
>>
>> For example, if I compile the following program:
>>
>> int main() {
>>   double d = 1.5;
>>   e = d + 2;
>> }
>>
>> I get the following:
>>
>> $ g++ junk.cc
>> junk.cc: In function â:
>> junk.cc:3: error: â was not declared in this scope
>>
>
>  I tried it with my (64bit) SL5 machine and do not see the problem:
> ...
>  Hmm, I suspect you'll see mangled non-printable characters from my
> cut/paste (while it looked fine on my screen), which brings me to the other
> observation I have: the gcc 4.1.2 build we have made standalone (for use
> also on SLC4) machines _does_ have the kind of problem you mention. It is
> some bad interaction with the LANG (and terminal?) setting, I think, and
> I've not had time to track it down (would be great if someone here has some
> suggestion!), but I've found that if I use the workaround:
>
> unsetenv LANG

yes, this works.  To see it more clearly:

$ echo $LANG
en_CA.UTF-8
$ g++ eg.cc 2>t.out
$ od -c t.out
0000000   e   g   .   c   c   :       I   n       f   u   n   c   t   i
0000020   o   n     342 200 230   i   n   t       m   a   i   n   (   )
0000040 342 200 231   :  \n   e   g   .   c   c   :   4   :       e   r
0000060   r   o   r   :     342 200 230   e 342 200 231       w   a   s
0000100       n   o   t       d   e   c   l   a   r   e   d       i   n
0000120       t   h   i   s       s   c   o   p   e  \n
0000134

and when unsetting the LANG var, the above chars become plain ascii:
$ od -c t.out
0000000   e   g   .   c   c   :       I   n       f   u   n   c   t   i
0000020   o   n       '   i   n   t       m   a   i   n   (   )   '   :
0000040  \n   e   g   .   c   c   :   4   :       e   r   r   o   r   :
0000060       '   e   '       w   a   s       n   o   t       d   e   c
0000100   l   a   r   e   d       i   n       t   h   i   s       s   c
0000120   o   p   e  \n
0000124

cheers, etc.
-- 
deatrich @ triumf.ca, Science/Atlas         PH: +1 604-222-7665
<*> This moment's fortune cookie:
Comedy, like Medicine, was never meant to be practiced by the general public.



ATOM RSS1 RSS2