Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C89 compatibility question Date: Mon, 27 Jul 2015 11:51:22 -0700 Organization: None to speak of Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="19957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+68M8mpd2ck/L7Igh7itpf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:/D4fZfofwMATa6+9sTNeYZoRVgg= sha1:02D1GjVJJ/mJRu10/6Os02BnX5c= Xref: csiph.com comp.lang.c:66457 "Bill Cunningham" writes: > I have this code so far to read a JFIF file and prehaps put it in a > wrapper of sorts. > > Struct JFIF_HEAD { > uint8_t SOI={0xff,0xd8}; It's "struct", not "Struct". > Not much I know. But I am already going to have to use stdint.h which is > fine for me; but not C89. Is there an unsigned int that can be 8 bit in C89? > The only thing in C89 I know of that is 8 bit is a char. If I remember > correctly without going back and looking. I'm pretty confident I'm right. > > Could anything C89 replace uint8_t? unsigned char is very likely to be the same as uint8_t. It's not guaranteed (which is why uint8_t was added by C99), but it's easily checked by examining the value of UCHAR_MAX in . There are C89-compatible implementations of . One of them is here: http://www.lysator.liu.se/(nobg)/c/q8/index.html Why are you restricted to C89? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"