public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: gcc on Sparc Solaris 8
       [not found] <1157198014.1780392.1569854535577.ref@mail.yahoo.com>
@ 2019-09-30 14:42 ` rolf perau via gcc-help
  2019-09-30 19:23   ` Dennis Clarke
  0 siblings, 1 reply; 9+ messages in thread
From: rolf perau via gcc-help @ 2019-09-30 14:42 UTC (permalink / raw)
  To: gcc-help

my program has a long history.
Build on Sparc 1, 2 and then Ultra Sparc with
Solaris 2.5 using the Sun Compiler and Debugger. I never had a problem with it.


now ported to Ultra Sparc 10 and also PC.
os is Solaris 10 build with Solaris Developer Studio 12.3
I never had a problem with it.

but in Solaris 10 there are problems with X11 libraries. For example: XAllocColorCells is not working. That's why I am now on Solaris 8. No Problems with X11. Sadly I have
for Solaris 8 no Sun / Oracle compiler and now has to use GCC. bu now I have problems with the flashing of Flotingpoint Values.

I understand it this way, the Floating Point Numbers representaion is nnn dot nnn like 123.456 and never with comma.
Rolf.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
  2019-09-30 14:42 ` gcc on Sparc Solaris 8 rolf perau via gcc-help
@ 2019-09-30 19:23   ` Dennis Clarke
  0 siblings, 0 replies; 9+ messages in thread
From: Dennis Clarke @ 2019-09-30 19:23 UTC (permalink / raw)
  To: gcc-help


> but in Solaris 10 there are problems with X11 libraries.

  For example: XAllocColorCells is not working.


A very basic Xlib function is not working ??  Really ??

This ?

      Status XAllocColorCells(display, colormap, contig,
      plane_masks_return, nplanes,
                                pixels_return, npixels)
            Display *display;
            Colormap colormap;
            Bool contig;
            unsigned long plane_masks_return[];
            unsigned int nplanes;
            unsigned long pixels_return[];
            unsigned int npixels;


As for floating point numbers.

Floating point numbers exist in binary with a trivial format of a sign
bit and then some bits for an exponent and then lastly a string of bits
to represent the significand.  The significand ( or mantissa ) data also
has an implied leading bit of "1" for normal numbers.  How you choose to
print them out is entirely your business.

The Oracle Solaris 12.6 Developer tools are a free download and I do
suggest you look at them. I am fairly sure that support for Solaris in
gcc has been dropped as of last year. At least for Solaris 10. Sadly I 
have never seen Solaris 11 in the wild. Maybe that works and maybe it 
does not. Have you considered simply moving over to FreeBSD or even dare 
I say it Linux?  I have heard in various places that this "Linux" thing 
works quite well and I have even seen it running neatly.  Could be worth
a look. :) Just don't go lookng too closely for POSIX compliance or even
cross platform clean compiles.

-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
       [not found] <370931742.2089515.1569886162496.ref@mail.yahoo.com>
@ 2019-09-30 23:29 ` rolf perau via gcc-help
  0 siblings, 0 replies; 9+ messages in thread
From: rolf perau via gcc-help @ 2019-09-30 23:29 UTC (permalink / raw)
  To: gcc-help

Hi,

Many thanks to all, to show me the right way to solve my problem.
I changed all LC_xxx to C in / etc / TIMEZONE.
Reboot the system make all my program. my PROBLEM SOLVED!

Bey the way, the X11 problem in Solaris 10 is known and well described. But I could not find an update for it. CVE-213-1997. But I would like to have a solution.

Thank you ALL!

Rolf Perau

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
  2019-09-30 13:32 ` rolf perau via gcc-help
  2019-09-30 13:39   ` Jonathan Wakely
@ 2019-09-30 19:36   ` Dennis Clarke
  1 sibling, 0 replies; 9+ messages in thread
From: Dennis Clarke @ 2019-09-30 19:36 UTC (permalink / raw)
  To: gcc-help

On 9/30/19 9:32 AM, rolf perau via gcc-help wrote:
> Hi Dennis,

Put a locale on the command line or just allow POSIX :

     if ( argc > 1 ) {
         printf ("\nINFO : You suggest a locale of %s\n", argv[1]);
         buf = setlocale ( LC_ALL, argv[1] );
     } else {
         buf = setlocale ( LC_ALL, "POSIX" );
     }

     if ( buf == NULL ) {
         fprintf (stderr,"FAIL : setlocale fail\n");
         return(EXIT_FAILURE);
     }


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
https://twitch.tv/lastmiles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
  2019-09-30 13:39   ` Jonathan Wakely
@ 2019-09-30 19:34     ` Dennis Clarke
  0 siblings, 0 replies; 9+ messages in thread
From: Dennis Clarke @ 2019-09-30 19:34 UTC (permalink / raw)
  To: gcc-help


> In any case, sscanf is not part of GCC, it comes from the Solaris C
> library, so this is not a GCC problem.
> 

This is not a GCC problem and not even a Solaris problem.

He needs to simply setlocale first :

      #include <locale.h>
      char *setlocale(int category, const char *locale);

Problem solved.


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
  2019-09-30 13:32 ` rolf perau via gcc-help
@ 2019-09-30 13:39   ` Jonathan Wakely
  2019-09-30 19:34     ` Dennis Clarke
  2019-09-30 19:36   ` Dennis Clarke
  1 sibling, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2019-09-30 13:39 UTC (permalink / raw)
  To: rolf perau; +Cc: gcc-help

On Mon, 30 Sep 2019 at 14:33, rolf perau via gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi Dennis,
> int scan_assign_double(ScanFILE *psf, double *pd, void *userdata, ScanFLAG flags){
>         char temp[100];
>
>         if (scan_nonblank(psf) == '=') fgetc(psf->fp);
>         if (scan_word(psf, temp, sizeof(temp)-1)) return -1;
>
> fprintf( stderr, "Reading the String : %s\n", temp);
>
>         if (sscanf(temp, " %lf ", pd) != 1) {
>                 error_out(err_scan_expect_double, temp, psf->filename, psf->linum);
>                 return -1;
>         }
>
> fprintf( stderr, "%s %lf\n\n", "After sscanf %lf :" , *pd);
>
>         if (scan_nonblank(psf) == ';') fgetc(psf->fp);
>         return 0;
> }
>
> Resulting in :
>
> Reading the String : 0.7
> After sscanf %lf : 0,000000
>
> Reading the String : 5257.872067
> After sscanf %lf : 5257,000000
>
> Reading the String : 152.498875
> After sscanf %lf : 152,000000
>
> Reading the String : 12.0
> After sscanf %lf : 12,000000
>
> Reading the String : 0.7
> After sscanf %lf : 0,000000


This looks pretty obviously related to locales. Your locale expects
',' as a decimal point, but the numbers you are trying to read have
'.' for decimal points. That means sscanf stops reading the number at
the '.' character, because that's the end of the string that matches
the expected format for a number.

In any case, sscanf is not part of GCC, it comes from the Solaris C
library, so this is not a GCC problem.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
       [not found] <2147124760.1726006.1569850372525.ref@mail.yahoo.com>
@ 2019-09-30 13:32 ` rolf perau via gcc-help
  2019-09-30 13:39   ` Jonathan Wakely
  2019-09-30 19:36   ` Dennis Clarke
  0 siblings, 2 replies; 9+ messages in thread
From: rolf perau via gcc-help @ 2019-09-30 13:32 UTC (permalink / raw)
  To: gcc-help

Hi Dennis, 
int scan_assign_double(ScanFILE *psf, double *pd, void *userdata, ScanFLAG flags){
        char temp[100];

        if (scan_nonblank(psf) == '=') fgetc(psf->fp);
        if (scan_word(psf, temp, sizeof(temp)-1)) return -1;

fprintf( stderr, "Reading the String : %s\n", temp);

        if (sscanf(temp, " %lf ", pd) != 1) {
                error_out(err_scan_expect_double, temp, psf->filename, psf->linum);
                return -1;
        }

fprintf( stderr, "%s %lf\n\n", "After sscanf %lf :" , *pd);

        if (scan_nonblank(psf) == ';') fgetc(psf->fp);
        return 0;
}

Resulting in :

Reading the String : 0.7
After sscanf %lf : 0,000000

Reading the String : 5257.872067
After sscanf %lf : 5257,000000

Reading the String : 152.498875
After sscanf %lf : 152,000000

Reading the String : 12.0
After sscanf %lf : 12,000000

Reading the String : 0.7
After sscanf %lf : 0,000000



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc on Sparc Solaris 8
  2019-09-30  4:55 ` rolf perau via gcc-help
@ 2019-09-30  6:11   ` Dennis Clarke
  0 siblings, 0 replies; 9+ messages in thread
From: Dennis Clarke @ 2019-09-30  6:11 UTC (permalink / raw)
  To: gcc-help

On 9/30/19 12:54 AM, rolf perau via gcc-help wrote:
> Hi all,
> 
> I use GCC 4.7.2  on Solaris 8 SPARC and have the following problem...
> 
> For example, a text string "1.5" will be changed to "1,000000", or "0.3" will be changed to "0,0000000".
> 
> 
> maybe someone can help me to solve the problem, I would be very happy !!!
> 

You should at least provide some sample code.



-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders included

^ permalink raw reply	[flat|nested] 9+ messages in thread

* gcc on Sparc Solaris 8
       [not found] <691082870.1339340.1569819291085.ref@mail.yahoo.com>
@ 2019-09-30  4:55 ` rolf perau via gcc-help
  2019-09-30  6:11   ` Dennis Clarke
  0 siblings, 1 reply; 9+ messages in thread
From: rolf perau via gcc-help @ 2019-09-30  4:55 UTC (permalink / raw)
  To: gcc-help

Hi all,

I use GCC 4.7.2  on Solaris 8 SPARC and have the following problem...

For example, a text string "1.5" will be changed to "1,000000", or "0.3" will be changed to "0,0000000".


maybe someone can help me to solve the problem, I would be very happy !!!


Rolf Perau

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-30 23:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1157198014.1780392.1569854535577.ref@mail.yahoo.com>
2019-09-30 14:42 ` gcc on Sparc Solaris 8 rolf perau via gcc-help
2019-09-30 19:23   ` Dennis Clarke
     [not found] <370931742.2089515.1569886162496.ref@mail.yahoo.com>
2019-09-30 23:29 ` rolf perau via gcc-help
     [not found] <2147124760.1726006.1569850372525.ref@mail.yahoo.com>
2019-09-30 13:32 ` rolf perau via gcc-help
2019-09-30 13:39   ` Jonathan Wakely
2019-09-30 19:34     ` Dennis Clarke
2019-09-30 19:36   ` Dennis Clarke
     [not found] <691082870.1339340.1569819291085.ref@mail.yahoo.com>
2019-09-30  4:55 ` rolf perau via gcc-help
2019-09-30  6:11   ` Dennis Clarke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).