Skip to Content.
Sympa Menu

freetds - RE: [freetds] A new patch - various fixes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] A new patch - various fixes
  • Date: Wed, 19 Mar 2003 11:45:55 -0500

> From: Thompson, Bill D (London) [mailto:ThompBil AT exchange.uk.ml.com]
> Sent: March 19, 2003 9:42 AM
>
> Also changed initialisation of
> a structure in bcp.c - my compiler (Sun workshop cc 4.2) objected...

Lemme get this straight. Your compiler complained about:

TDS_PBCB colclause = { clause_buffer, sizeof(clause_buffer) };

even though both values are known at compile time (never mind that it's an
ANSI standard construction)? I find this hard to believe, not because I
don't trust you, but because I've been initializing structures that way
since before Bill Gates dropped out of Harvard. It's explained and
illustrated in section 6.3 of "The C Programming Language", copyright 1988.


Does this work:

enum {CLAUSE_BUFFER_SIZE = 4096};
char clause_buffer[CLAUSE_BUFFER_SIZE] = {0};
TDS_PBCB colclause = { clause_buffer, CLAUSE_BUFFER_SIZE };

Does this:

#define CLAUSE_BUFFER_SIZE 4096
char clause_buffer[CLAUSE_BUFFER_SIZE] = {0};
TDS_PBCB colclause = { clause_buffer, CLAUSE_BUFFER_SIZE };

Section 2.4 of the same book, wherein initialization of variables is
described, says initialization of automatic variables may be done with "any
expression". I think someone should mention this to Sun? I could send them
a copy.

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.





Archive powered by MHonArc 2.6.24.

Top of Page