edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] Microsoft C
@ 2015-09-26 15:11 Karl Dahlke
  2015-09-26 15:36 ` Chris Brannon
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Dahlke @ 2015-09-26 15:11 UTC (permalink / raw)
  To: Edbrowse-dev

gcc allows us to define variables anywhere in a block, but Studio C does not.
In the interest of a possible windows port, I request all developers
keep variable definitions at the top of each function or block,
as per K&R.
I already do this, almost all the time,
but I slipped / forgot on a few occasions,
and I am fixing these now.

Karl Dahlke

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Edbrowse-dev] Microsoft C
  2015-09-26 15:11 [Edbrowse-dev] Microsoft C Karl Dahlke
@ 2015-09-26 15:36 ` Chris Brannon
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Brannon @ 2015-09-26 15:36 UTC (permalink / raw)
  To: Edbrowse-dev

Karl Dahlke <eklhad@comcast.net> writes:

> gcc allows us to define variables anywhere in a block, but Studio C does not.
> In the interest of a possible windows port, I request all developers
> keep variable definitions at the top of each function or block,
> as per K&R.

It's not gcc.  This was introduced with the C99 standard.  I wonder if
Visual Studio can be told that code is C99?
If not, oh well.

On the other hand, gcc allows mixed declarations and code regardless of
the standard.  If you build with -Wall -pedantic and aren't compiling
C99 or C++, it'll complain about mixed declarations and code, but it
will happily compile it.

-- Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-26 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-26 15:11 [Edbrowse-dev] Microsoft C Karl Dahlke
2015-09-26 15:36 ` Chris Brannon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).