Post 9gEKJRWdRFcc8xUAhk by uwehermann@fosstodon.org
(DIR) More posts by uwehermann@fosstodon.org
(DIR) Post #9gE54Ix5X7HVtiBMrA by karen@kawen.space
2019-02-26T12:03:29.688259Z
0 likes, 1 repeats
wow there's signed and unsigned chars that's messed up
(DIR) Post #9gE5JQtIIbacrZcaAa by lanodan@queer.hacktivis.me
2019-02-26T12:06:13.349106Z
1 likes, 0 repeats
@karen Well, a non-array char is basically an integer so maybe it would make sense that way.
(DIR) Post #9gE5NGcsPBsABZlpce by karen@kawen.space
2019-02-26T12:06:55.473948Z
0 likes, 0 repeats
@lanodan i find it funny that you can assign a char literal to an integer variable and vice-versa
(DIR) Post #9gE5Nmhx7qwlgaOKye by mansr@society.oftrolls.com
2019-02-26T12:06:41Z
2 likes, 0 repeats
@karen It gets worse. Whether a plain char is signed or unsigned is unspecified, and it varies between compilers and machine types.
(DIR) Post #9gE5OE5zIbDQcwqPgm by karen@kawen.space
2019-02-26T12:07:05.048731Z
0 likes, 0 repeats
@mansr 😂
(DIR) Post #9gE5S3Taituwqmi6sq by mansr@society.oftrolls.com
2019-02-26T12:07:39Z
1 likes, 0 repeats
@karen And a char isn't necessarily 8 bits either. There are systems where all the integer types (char, short, int, long) are 32 bits, and this is perfectly valid.
(DIR) Post #9gE5T5JXNLu2q8Uz68 by karen@kawen.space
2019-02-26T12:07:57.539129Z
0 likes, 0 repeats
@mansr messed up
(DIR) Post #9gE5YxRFZOM49SuHei by tuxcrafting@pleroma.tuxcrafting.cf
2019-02-26T12:09:02.734028Z
2 likes, 0 repeats
@karen @mansr it makes sense when you consider C is made to be able to run on basically everythingincluding shit like DSPs which rarely have a concept of 8-bit bytes
(DIR) Post #9gE5b5BtiYVSm4jt3I by lanodan@queer.hacktivis.me
2019-02-26T12:09:24.777113Z
1 likes, 0 repeats
@karen Funny but also just makes you want to yell when you do printf("%s", '\n'); and it tells you that it's an integer so it can't. (so putchar is required)
(DIR) Post #9gE5eAQMiUZHsFydcW by lain@kawen.space
2019-02-26T12:09:59.109522Z
3 likes, 0 repeats
@karen it's useful if you want to write -A
(DIR) Post #9gE5g2fyUlymQGAk3U by karen@kawen.space
2019-02-26T12:10:10.828588Z
3 likes, 0 repeats
@lain WHY WOULD I EVER WANT TO WRITE -A
(DIR) Post #9gE5m7zrcqtaf7NRtg by kaniini@pleroma.site
2019-02-26T12:11:01.287797Z
0 likes, 0 repeats
@lanodan @karen %c
(DIR) Post #9gE5ogl9LkbJ3WiRXM by lanodan@queer.hacktivis.me
2019-02-26T12:11:52.213111Z
0 likes, 0 repeats
@mansr Well, Plan9 uses 32 bits for char if I remember well. (they are using UTF-32 everywhere)
(DIR) Post #9gE5rPpwixr1RLG9ya by mansr@society.oftrolls.com
2019-02-26T12:12:06Z
1 likes, 0 repeats
@karen In C99, there are _optional_ types called int8_t, int16_t, and so on. If these exist, they must have the size indicated.
(DIR) Post #9gE5sIgcnK4tYMJzaC by eal@social.sakamoto.gq
2019-02-26T12:12:28.262746Z
0 likes, 0 repeats
@karen @lanodan >char literalWhat is sizeof('a')?
(DIR) Post #9gE5zRmdN36jnHXXxA by kaniini@pleroma.site
2019-02-26T12:13:47.448621Z
0 likes, 0 repeats
@eal @karen @lanodan 1
(DIR) Post #9gE62miXzjpnaYDhp2 by lanodan@queer.hacktivis.me
2019-02-26T12:14:25.209570Z
0 likes, 0 repeats
@eal no idea and 9front VM corrupted it's FS apparently.
(DIR) Post #9gE6774oF4sntChGjI by karen@kawen.space
2019-02-26T12:15:12.607273Z
0 likes, 0 repeats
@eal @lanodan 4
(DIR) Post #9gE6DMKSRmLgvnzjLk by ivesen@miniwa.moe
2019-02-26T12:16:19.618454Z
0 likes, 0 repeats
@karen in java all chars are signed
(DIR) Post #9gE6Rfb7bRiakLc3yC by eal@social.sakamoto.gq
2019-02-26T12:18:52.054486Z
0 likes, 0 repeats
@kaniini @karen @lanodan upgrade to a modern architecture grandpa
(DIR) Post #9gE6c9i0VPRd1vpjwe by lanodan@queer.hacktivis.me
2019-02-26T12:20:48.649522Z
0 likes, 0 repeats
@karen @eal CHAR_BIT == 8sizeof(char) == 8Â bits, 1Â byte;sizeof('a') == 4 bytes; 32 bits
(DIR) Post #9gE6cCqGr8pykQisk4 by eal@social.sakamoto.gq
2019-02-26T12:20:46.212755Z
1 likes, 0 repeats
@karen @lanodan correct(ish), it's really an integer literal
(DIR) Post #9gE6nBXi1lczu4HArA by SwooshyCueb@chitter.xyz
2019-02-26T12:22:02Z
0 likes, 0 repeats
@lanodan @karen @eal utf32?
(DIR) Post #9gE6nBnf4SO8hXjuim by eal@social.sakamoto.gq
2019-02-26T12:22:46.595073Z
0 likes, 0 repeats
@SwooshyCueb @lanodan @karen int
(DIR) Post #9gE6nscpqaHJWQ0NJg by kaniini@pleroma.site
2019-02-26T12:22:43.836122Z
1 likes, 1 repeats
@eal @karen @lanodan i like my PDP11 just fine thank you
(DIR) Post #9gE6ofeHZzYDZ63isK by lanodan@queer.hacktivis.me
2019-02-26T12:23:03.893927Z
0 likes, 0 repeats
@SwooshyCueb @eal @karen Nah, that’s on gcc + glibc.Not yet 9front.
(DIR) Post #9gEKJRWdRFcc8xUAhk by uwehermann@fosstodon.org
2019-02-26T14:49:50Z
1 likes, 0 repeats
@tuxcrafting @karen @mansr Yeah, apparently there's DSPs out there where CHAR_BIT is 16 or 12 or 9 or 40. You can be quite sure that pretty much zero software or libraries will be portable enough to work there out of the box, unless specifically designed for those systems.