Ticket #21 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Add stdint.h / inttypes.h

Reported by: debrouxl Owned by: debrouxl
Priority: major Milestone: Version 1.00
Component: project Version: 0.96
Keywords: Cc:

Description

These (simple) standard C99 headers are absent from TIGCC.

Kevin didn't merge PpHd?'s patch for stdint.h, because he says it came with no documentation in TIGCC help system format. I don't think Kevin was _100%_ wrong refusing the patch. That said, the TIGCC help system makes it harder than needed to create documentation of several dozen typedefs + macros. We could use some auto-generation from a template here...

Attachments

genstdint.pl Download (4.3 KB) - added by debrouxl 3 years ago.
Simple generator for stdint.h documentation
inttypes.h Download (3.5 KB) - added by debrouxl 3 years ago.
inttypes.h file used as input for geninttypes.pl
geninttypes.pl Download (2.8 KB) - added by debrouxl 3 years ago.
Simple generator for inttypes.h documentation
stdint.h Download (2.9 KB) - added by debrouxl 3 years ago.
stdint.h file used as input for genstdint.pl

Change History

comment:1 Changed 3 years ago by debrouxl

I've just committed (r1267) documentation/definition files for stdint.h.

Notes (see  http://box.godzil.net/pipermail/tigccpp/2008-September/000031.html ):

  • INT_(LEAST|FAST)N_MIN are defined as −(2(N−1)−1) , as written in C99+TC1+TC2 specification. In glibc, they are defined as −2N−1, i.e. they're equal to INTN_MIN. Don't know what's most sensible.
  • INTPTR_MIN, INTPTR_MAX and UINTPTR_MAX are 32-bit values. 16-bit values, as written in C99+TC1+TC2, don't look sensible. In glibc, they're also wider than 16 bits.

To build the headers, make sure that the trunk/tigcc/doc/Programs/HelpSystem.ini contains correct values, e.g.

SystemFolder=C:\doc\System [trunk/tigcc/doc/System]
SourceFolder=C:\doc [junction / symlink to trunk/tigcc/doc]
DestFolder=C:\docfiles\CHMFiles [initialized with the contents of trunk/tigcc/doc/System/CHMFiles]
WebFolder=C:\docfiles\WebFiles [initialized with the contents of trunk/tigcc/doc/System/WebFiles]
IncludeFolder=C:\include\C [initialized with the contents of trunk/tigcc/include/C]
ExamplesFolder=C:\examples [initialized with the contents of trunk/tigcc/examples]

Then, add the following empty stdint.h in C:\include\C:

#ifndef __STDINT
#define __STDINT

#include <default.h>

/* Begin Auto-Generated Part */

/* End Auto-Generated Part */

#endif

You can now run trunk/tigcc/doc/Programs/Update/UpdateInclude.exe (it has always worked perfectly for me under Wine latest git) to generate an updated documentation in C:\docfiles and updated headers in C:\include\C.

Changed 3 years ago by debrouxl

Simple generator for stdint.h documentation

Changed 3 years ago by debrouxl

inttypes.h file used as input for geninttypes.pl

comment:2 Changed 3 years ago by debrouxl

  • Status changed from new to closed
  • Resolution set to fixed

r1277 adds several macros of inttypes.h. As detailed in inttypes.hsh, some definitions mandated by the C99 standard are missing in this inttypes.h, because the 64-bit types are not handled by printf and scanf.

This ticket can therefore be closed.

Changed 3 years ago by debrouxl

Simple generator for inttypes.h documentation

comment:3 Changed 3 years ago by debrouxl

  • Owner set to debrouxl

r1292 fixes a name clash between PRIx*.hsf and PRIX*.hsf on case-insensitive filesystems.

Changed 3 years ago by debrouxl

stdint.h file used as input for genstdint.pl

comment:4 Changed 3 years ago by debrouxl

r1294-1295 make int_fast8_t and uint_fast8_t the same as int16_t and uint16_t, to match upstream.
This is because division is faster with 16-bit types than with 8-bit types, as 8-bit types require sign/zero extension.

Note: See TracTickets for help on using tickets.