octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MinGW isprint test


From: Philip Nienhuis
Subject: Re: MinGW isprint test
Date: Wed, 29 Aug 2012 12:21:37 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

Michael Goffioul wrote:


On Wed, Aug 29, 2012 at 10:56 AM, Philip Nienhuis <address@hidden
<mailto:address@hidden>> wrote:

    Michael Goffioul wrote:

        On Wed, Aug 29, 2012 at 10:20 AM, Philip Nienhuis
        <address@hidden <mailto:address@hidden>
        <mailto:address@hidden <mailto:address@hidden>>__>
        wrote:

             Philip Nienhuis wrote:

                 Rik wrote:

                     - mappers.cc: assert (isprint (charset), result)
        differs in
                     column 10.
                     \r\n versus \n line endings?

                     8/28/12

                     Philip,

                     This one should be easy to check. Can you try the
        following
                     at the
                     command line?

                     isprint ("\n")
                     isprint ("\r")

                     On Unix systems these are both false. It sounds like
                     character 10
                     ("\n") may be considered printable no MinGW.


                 Both give 0.

                 For completeness here are the relevant results from
        fntest.log:

                 assert (isprint (charset),result) expected
                 Columns 1 through 22:

                 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
                 :
                 but got
                 Columns 1 through 22:

                 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0

                 But:
                 octave.exe:2> isprint ( "\t")
                 ans = 1

                 so it is TAB that is considered printable. Sorry for my
        miscounting.
                 BTW isprint ("\t") does the same on octave-3.6.2_MinGW and
                 3.4.3_MinGW.
                 Apparently the test is wrong.


             That should read: on MinGW the result of isprint ("\t")
        seems wrong.


        Indeed. I thought the reason was the Windows C runtime
        implementation,
        but I compiled a simple C test program to check the return value of
        "isprint" under MSVC, and it returns 0 for the TAB character
        (char 9).
        This calls for further investigation.


    If you send me that test prog source I could try to compile and run
    it under MinGW/gcc. I suppose it is a tiny proggie


#include <ctype.h>
#include <stdio.h>

int main()
{
   int i;

   for (i = 0; i < 128; i++)
     printf ("%d: %d\n", i, isprint(i));
   return 0;
}

address@hidden ~/octdev/dev/isprint
$ gcc main.cc

address@hidden ~/octdev/dev/isprint
$ ls -l
total 24
-rwxr-xr-x 1 Philip Administrators 22705 Aug 29 12:16 a.exe
-rw-r--r-- 1 Philip Administrators   155 Aug 29 12:15 main.cc

address@hidden ~/octdev/dev/isprint
$ a
0: 0
1: 0
2: 0
3: 0
4: 0
5: 0
6: 0
7: 0
8: 0
9: 0
10: 0
11: 0
12: 0
13: 0
14: 0
15: 0
16: 0
17: 0
18: 0
19: 0
20: 0
21: 0
22: 0
23: 0
24: 0
25: 0
26: 0
27: 0
28: 0
29: 0
30: 0
31: 0
32: 64
33: 16
34: 16
35: 16
36: 16
37: 16
38: 16
39: 16
40: 16
41: 16
42: 16
43: 16
44: 16
45: 16
46: 16
47: 16
48: 4
49: 4
50: 4
51: 4
52: 4
53: 4
54: 4
55: 4
56: 4
57: 4
58: 16
59: 16
60: 16
61: 16
62: 16
63: 16
64: 16
65: 1
66: 1
67: 1
68: 1
69: 1
70: 1
71: 1
72: 1
73: 1
74: 1
75: 1
76: 1
77: 1
78: 1
79: 1
80: 1
81: 1
82: 1
83: 1
84: 1
85: 1
86: 1
87: 1
88: 1
89: 1
90: 1
91: 16
92: 16
93: 16
94: 16
95: 16
96: 16
97: 2
98: 2
99: 2
100: 2
101: 2
102: 2
103: 2
104: 2
105: 2
106: 2
107: 2
108: 2
109: 2
110: 2
111: 2
112: 2
113: 2
114: 2
115: 2
116: 2
117: 2
118: 2
119: 2
120: 2
121: 2
122: 2
123: 16
124: 16
125: 16
126: 16
127: 0

address@hidden ~/octdev/dev/isprint
$

Apart from the value of non-zero numbers (wide characters?) I see nothing wrong with MinGW isprint().

What else can I do to dig further?

P.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]