By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,530 Members | 880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,530 IT Pros & Developers. It's quick & easy.

New -pedantic option for lcc-win32

P: n/a
Due to popular demand (specially from Mr Heathfield), I have
introduced a

-pedantic

compiler flag, that will be as the -ansic option but stricter.

This flag will make

_stdcall

no longer a recognized part of the language.

Anonymous structures will not be accepted either.

jacob
Sep 15 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
jacob navia said:
Due to popular demand (specially from Mr Heathfield),
I demanded no such thing. All I said was that lcc-win32 is not a conforming
C implementation. Whether lcc-win32 is conforming is of little concern to
me, since I no longer include it in my resources list, and no longer
recommend it in IRC - both of which are direct consequences of Mr Navia's
determination to treat comp.lang.c as an advertising hoarding.
I have introduced a -pedantic compiler flag, that will be as the -ansic
option but stricter.
That's rather cold comfort for those who relied on Mr Navia's /existing/
implementation being conforming. Still, at least it shows that he is able,
on occasion, to recognise the importance of conformance, and that's a step
in the right direction.
This flag will make _stdcall no longer a recognized part of the language.
_stdcall has *never* been a recognised part of the C language.
Anonymous structures will not be accepted either.
And what other conformance issues lie dormant within lcc-win32? Only time
will tell.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 15 '06 #2

P: n/a
"jacob navia" <ja***@jacob.remcomp.frwrote in message
Due to popular demand (specially from Mr Heathfield), I have
introduced a

-pedantic

compiler flag, that will be as the -ansic option but stricter.

This flag will make

_stdcall

no longer a recognized part of the language.

Anonymous structures will not be accepted either.
What about slash slash comments?
I decided a while back that surely these were sufficiently well established
to regard as standard, only to get an MPI compiler with distinctly
old-fashioned ideas.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.
Sep 15 '06 #3

P: n/a
"Malcolm" <re*******@btinternet.comwrites:
"jacob navia" <ja***@jacob.remcomp.frwrote in message
>Due to popular demand (specially from Mr Heathfield), I have
introduced a

-pedantic

compiler flag, that will be as the -ansic option but stricter.

This flag will make

_stdcall

no longer a recognized part of the language.

Anonymous structures will not be accepted either.
What about slash slash comments?
I decided a while back that surely these were sufficiently well established
to regard as standard, only to get an MPI compiler with distinctly
old-fashioned ideas.
That's a different issue. "//" comments are legal in C99, but illegal
in C90. _stdcall and anonymous structures are not legal in *any* C
standard.

<OT>
I think lcc-win32 has an option that causes it to attempt to conform
to C90 and another that causes it to attempt to conform to C99 (though
last I heard there are some C99 features that aren't yet implemented).
If these options are done properly, then it will reject "//" comments
in C90 mode and accept them in C99 mode.
</OT>

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 15 '06 #4

P: n/a
Keith Thompson said:
_stdcall and anonymous structures are not legal in *any* C
standard.
_stdcall is in implementation namespace, so it's perfectly legal for C
implementations to use it for any reasonable purpose they like. For
example, one implementation might use it as a prefix for a function name,
with the intent that any function prefixed in such a way is run remotely
over a phone connection ("subscriber trunk dialling call").

Anonymous structures, though, are a syntax error, and a diagnostic is
required.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 15 '06 #5

P: n/a
Richard Heathfield <in*****@invalid.invalidwrites:
Anonymous structures, though, are a syntax error, and a diagnostic is
required.
You can fake them, though, if you have sufficiently poor taste.
For example, a quick grep in my system's implementation headers
found this abortion:

typedef struct siginfo {
int si_signo;
int si_errno;
int si_code;

union {
int _pad[SI_PAD_SIZE];

/* kill() */
struct {
pid_t _pid; /* sender's pid */
__ARCH_SI_UID_T _uid; /* sender's uid */
} _kill;

/* POSIX.1b timers */
struct {
timer_t _tid; /* timer id */
int _overrun; /* overrun count */
char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
sigval_t _sigval; /* same as below */
int _sys_private; /* not to be passed to user */
} _timer;

/* POSIX.1b signals */
struct {
pid_t _pid; /* sender's pid */
__ARCH_SI_UID_T _uid; /* sender's uid */
sigval_t _sigval;
} _rt;

/* SIGCHLD */
struct {
pid_t _pid; /* which child */
__ARCH_SI_UID_T _uid; /* sender's uid */
int _status; /* exit code */
clock_t _utime;
clock_t _stime;
} _sigchld;

/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
struct {
void __user *_addr; /* faulting insn/memory ref. */
#ifdef __ARCH_SI_TRAPNO
int _trapno; /* TRAP # which caused the signal */
#endif
} _sigfault;

/* SIGPOLL */
struct {
__ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG *
/
int _fd;
} _sigpoll;
} _sifields;
} siginfo_t;

#endif

/*
* How these fields are to be accessed.
*/
#define si_pid _sifields._kill._pid
#define si_uid _sifields._kill._uid
#define si_tid _sifields._timer._tid
#define si_overrun _sifields._timer._overrun
#define si_sys_private _sifields._timer._sys_private
#define si_status _sifields._sigchld._status
#define si_utime _sifields._sigchld._utime
#define si_stime _sifields._sigchld._stime
#define si_value _sifields._rt._sigval
#define si_int _sifields._rt._sigval.sival_int
#define si_ptr _sifields._rt._sigval.sival_ptr
#define si_addr _sifields._sigfault._addr
#ifdef __ARCH_SI_TRAPNO
#define si_trapno _sifields._sigfault._trapno
#endif
#define si_band _sifields._sigpoll._band
#define si_fd _sifields._sigpoll._fd

On Unix-like systems you can probably find several like this
using a command similar to this, which is what I used:
grep '#define[[:space:]]\+[a-z]\+_[^.]*\.' /usr/include -r

--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p[i]\
);}return 0;}
Sep 16 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.