add version number to manpage

avoid c++/c99 style comments in preprocessor directives
avoid leadings whitespaces in preprocessor directives
mention implemented variable length arrays in documentation
fixed ambiguous option in texi2html call (Austin English)
master
Urs Janssen 2013-02-17 00:48:51 +01:00
parent d5e22108a0
commit 0bdbd49eac
22 changed files with 57 additions and 56 deletions

View File

@ -300,11 +300,11 @@ endif
# documentation and man page
tcc-doc.html: tcc-doc.texi
-texi2html -monolithic -number $<
-texi2html -monolithic -number-sections $<
tcc.1: tcc-doc.texi
-$(top_srcdir)/texi2pod.pl $< tcc.pod
-pod2man --section=1 --center=" " --release=" " tcc.pod > $@
-pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/VERSION` tcc.pod > $@
tcc-doc.info: tcc-doc.texi
-makeinfo $<

View File

@ -24,7 +24,7 @@
#ifdef TARGET_DEFS_ONLY
#ifdef TCC_ARM_EABI
#ifndef TCC_ARM_VFP // Avoid useless warning
#ifndef TCC_ARM_VFP /* Avoid useless warning */
#define TCC_ARM_VFP
#endif
#endif
@ -104,7 +104,7 @@ enum {
/* defined if structures are passed as pointers. Otherwise structures
are directly pushed on stack. */
//#define FUNC_STRUCT_PARAM_AS_PTR
/* #define FUNC_STRUCT_PARAM_AS_PTR */
/* pointer size, in bytes */
#define PTR_SIZE 4

View File

@ -20,7 +20,7 @@
#ifdef TARGET_DEFS_ONLY
//#define ASSEMBLY_LISTING_C67
/* #define ASSEMBLY_LISTING_C67 */
/* number of available registers */
#define NB_REGS 24
@ -93,11 +93,11 @@ enum {
#define REG_FRET TREG_C67_A4 /* float return register */
/* defined if function parameters must be evaluated in reverse order */
//#define INVERT_FUNC_PARAMS
/* #define INVERT_FUNC_PARAMS */
/* defined if structures are passed as pointers. Otherwise structures
are directly pushed on stack. */
//#define FUNC_STRUCT_PARAM_AS_PTR
/* #define FUNC_STRUCT_PARAM_AS_PTR */
/* pointer size, in bytes */
#define PTR_SIZE 4
@ -253,7 +253,7 @@ void gsym(int t)
#define C67_B3 107
#define C67_FP 108
#define C67_B2 109
#define C67_CREG_ZERO -1 // Special code for no condition reg test
#define C67_CREG_ZERO -1 /* Special code for no condition reg test */
int ConvertRegToRegClass(int r)

6
coff.h
View File

@ -37,8 +37,8 @@ struct filehdr {
#define F_BYTE_ORDER (F_LITTLE | F_BIG)
#define FILHDR struct filehdr
//#define FILHSZ sizeof(FILHDR)
#define FILHSZ 22 // above rounds to align on 4 bytes which causes problems
/* #define FILHSZ sizeof(FILHDR) */
#define FILHSZ 22 /* above rounds to align on 4 bytes which causes problems */
#define COFF_C67_MAGIC 0x00c2
@ -150,7 +150,7 @@ struct scnhdr {
/*------------------------------------------------------------------------*/
/* Define constants for names of "special" sections */
/*------------------------------------------------------------------------*/
//#define _TEXT ".text"
/* #define _TEXT ".text" */
#define _DATA ".data"
#define _BSS ".bss"
#define _CINIT ".cinit"

4
elf.h
View File

@ -1725,7 +1725,7 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_C60_GOTOFF 9 /* 32 bit offset to GOT */
#define R_C60_GOTPC 10 /* 32 bit PC relative offset to GOT */
#define R_C60HI16 0x55 // high 16 bit MVKH embedded
#define R_C60LO16 0x54 // low 16 bit MVKL embedded
#define R_C60HI16 0x55 /* high 16 bit MVKH embedded */
#define R_C60LO16 0x54 /* low 16 bit MVKL embedded */
#endif /* elf.h */

View File

@ -21,7 +21,7 @@
#include "tcc.h"
// #define NB_ASM_REGS 8
/* #define NB_ASM_REGS 8 */
#define MAX_OPERANDS 3
#define NB_SAVED_REGS 3

View File

@ -55,7 +55,7 @@ enum {
/* defined if structures are passed as pointers. Otherwise structures
are directly pushed on stack. */
//#define FUNC_STRUCT_PARAM_AS_PTR
/* #define FUNC_STRUCT_PARAM_AS_PTR */
/* pointer size, in bytes */
#define PTR_SIZE 4

View File

@ -53,11 +53,11 @@ const int reg_classes[NB_REGS] = {
#define REG_FRET REG_ST0 /* float return register */
/* defined if function parameters must be evaluated in reverse order */
//#define INVERT_FUNC_PARAMS
/* #define INVERT_FUNC_PARAMS */
/* defined if structures are passed as pointers. Otherwise structures
are directly pushed on stack. */
//#define FUNC_STRUCT_PARAM_AS_PTR
/* #define FUNC_STRUCT_PARAM_AS_PTR */
/* pointer size, in bytes */
#define PTR_SIZE 4

View File

@ -29,11 +29,11 @@
#include <unistd.h>
#endif
//#define BOUND_DEBUG
/* #define BOUND_DEBUG */
/* define so that bound array is static (faster, but use memory if
bound checking not used) */
//#define BOUND_STATIC
/* #define BOUND_STATIC */
/* use malloc hooks. Currently the code cannot be reliable if no hooks */
#define CONFIG_TCC_MALLOC_HOOKS

View File

@ -1018,7 +1018,7 @@ LIBTCCAPI TCCState *tcc_new(void)
s->char_is_unsigned = 1;
#endif
/* enable this if you want symbols with leading underscore on windows: */
#if 0 //def TCC_TARGET_PE
#if 0 /* def TCC_TARGET_PE */
s->leading_underscore = 1;
#endif
#ifdef TCC_TARGET_I386

View File

@ -388,13 +388,14 @@ and floating point numbers (@code{long double}, @code{double}, and
@section ISOC99 extensions
TCC implements many features of the new C standard: ISO C99. Currently
missing items are: complex and imaginary numbers and variable length
arrays.
missing items are: complex and imaginary numbers.
Currently implemented ISOC99 features:
@itemize
@item variable length arrays.
@item 64 bit @code{long long} types are fully supported.
@item The boolean type @code{_Bool} is supported.

28
tcc.h
View File

@ -98,21 +98,21 @@
#include "libtcc.h"
/* parser debug */
//#define PARSE_DEBUG
/* #define PARSE_DEBUG */
/* preprocessor debug */
//#define PP_DEBUG
/* #define PP_DEBUG */
/* include file debug */
//#define INC_DEBUG
/* #define INC_DEBUG */
/* memory leak debug */
//#define MEM_DEBUG
/* #define MEM_DEBUG */
/* assembler debug */
//#define ASM_DEBUG
/* #define ASM_DEBUG */
/* target selection */
//#define TCC_TARGET_I386 /* i386 code generator */
//#define TCC_TARGET_ARM /* ARMv4 code generator */
//#define TCC_TARGET_C67 /* TMS320C67xx code generator */
//#define TCC_TARGET_X86_64 /* x86-64 code generator */
/* #define TCC_TARGET_I386 *//* i386 code generator */
/* #define TCC_TARGET_ARM *//* ARMv4 code generator */
/* #define TCC_TARGET_C67 *//* TMS320C67xx code generator */
/* #define TCC_TARGET_X86_64 *//* x86-64 code generator */
/* default target is I386 */
#if !defined(TCC_TARGET_I386) && !defined(TCC_TARGET_ARM) && \
@ -894,7 +894,7 @@ struct TCCState {
DEF_ASM(x ## nle) \
DEF_ASM(x ## g)
#endif // defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
#endif /* defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 */
enum tcc_token {
TOK_LAST = TOK_IDENT - 1,
@ -909,10 +909,10 @@ enum tcc_token {
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#ifndef __GNUC__
#define strtold (long double)strtod
#define strtof (float)strtod
#define strtoll _strtoi64
#define strtoull _strtoui64
# define strtold (long double)strtod
# define strtof (float)strtod
# define strtoll _strtoi64
# define strtoull _strtoui64
#endif
#else
/* XXX: need to define this to use them in non ISOC99 context */

View File

@ -1835,7 +1835,7 @@ static int elf_output_file(TCCState *s1, const char *filename)
for(i = 1; i < s1->nb_sections; i++) {
s = s1->sections[i];
s->sh_name = put_elf_str(strsec, s->name);
#if 0 //gr
#if 0 /* gr */
printf("section: f=%08x t=%08x i=%08x %s %s\n",
s->sh_flags,
s->sh_type,

View File

@ -30,7 +30,7 @@
#endif
#define PE_MERGE_DATA
// #define PE_PRINT_SECTIONS
/* #define PE_PRINT_SECTIONS */
#ifdef TCC_TARGET_X86_64
# define ADDR3264 ULONGLONG

View File

@ -239,7 +239,7 @@ typedef struct {
#define SCNiPTR "i"
#define SCNoPTR "o"
#define SCNxPTR "x"
#define SCNuPTR "u"
#define SCNuPTR "u"
#endif
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

View File

@ -241,8 +241,8 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
/* Make sure macros are not defined. */
#pragma push_macro("vsnprintf")
#pragma push_macro("snprintf")
#undef vsnprintf
#undef snprintf
# undef vsnprintf
# undef snprintf
extern
__attribute__((format(gnu_printf, 3, 0))) __attribute__((nonnull (3)))
int __mingw_vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
@ -267,14 +267,14 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#pragma pop_macro("snprintf")
#pragma pop_macro("vsnprintf")
/* Check if vsnprintf and snprintf are defaulting to gnu-style. */
#if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF
#ifndef vsnprint
#define vsnprintf __mingw_vsnprintf
#endif
#ifndef snprintf
#define snprintf __mingw_snprintf
#endif
#endif
# if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF
# ifndef vsnprint
# define vsnprintf __mingw_vsnprintf
# endif
# ifndef snprintf
# define snprintf __mingw_snprintf
# endif
# endif
_CRTIMP int __cdecl _vscprintf(const char *_Format,va_list _ArgList);
_CRTIMP int __cdecl _set_printf_count_output(int _Value);
_CRTIMP int __cdecl _get_printf_count_output(void);

View File

@ -25,7 +25,7 @@ extern "C" {
#include <sys/types.h>
#ifndef __TINYC__ //gr
#ifndef __TINYC__ /* gr */
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T

View File

@ -22,7 +22,7 @@ extern "C" {
#define _CRTIMP __declspec(dllimport)
#endif
#ifndef __TINYC__ //gr
#ifndef __TINYC__ /* gr */
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T

View File

@ -12,7 +12,7 @@
#include <_mingw.h>
#ifndef __TINYC__ //gr
#ifndef __TINYC__ /* gr */
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T

View File

@ -27,7 +27,7 @@ extern "C" {
#define _WCHAR_T_DEFINED
#endif
#ifndef __TINYC__ //gr
#ifndef __TINYC__ /* gr */
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T

View File

@ -110,7 +110,7 @@ extern "C" {
typedef DWORD *PDWORD;
typedef DWORD *LPDWORD;
typedef void *LPVOID;
#ifndef _LPCVOID_DEFINED
# ifndef _LPCVOID_DEFINED
#define _LPCVOID_DEFINED
typedef CONST void *LPCVOID;
#endif

View File

@ -1763,7 +1763,7 @@
#ifndef WSA_QOS_RESERVED_PETYPE
#define WSA_QOS_RESERVED_PETYPE 11031L
#endif
#endif // WSABASEERR
#endif /* WSABASEERR */
#define ERROR_SXS_SECTION_NOT_FOUND 14000L
#define ERROR_SXS_CANT_GEN_ACTCTX 14001L
@ -3163,4 +3163,4 @@ __CRT_INLINE HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : (
#define COMADMIN_E_SAFERINVALID _HRESULT_TYPEDEF_(0x80110822L)
#define COMADMIN_E_REGISTRY_ACCESSDENIED _HRESULT_TYPEDEF_(0x80110823L)
#define COMADMIN_E_PARTITIONS_DISABLED _HRESULT_TYPEDEF_(0x80110824L)
#endif // _WINERROR_
#endif /* _WINERROR_ */