[Tfug] C Compiler string limitations?

Bexley Hall bexley401 at yahoo.com
Mon Jul 17 15:00:33 MST 2006


--- Robert Hunter <hunter at tfug.org> wrote:

> > I'm curious if anyone has had any experiences with
> > compilers choking on long strings/byte arrays.
> >
> > I have some data structures that look like:
> >
> > "..." ## "..." ## "..." (etc)
> >
> > and, in the interest of portability, would hope
> that
> > few compilers would gag on them.
> 
> C89 requires a minimum string literal size of 509
> C99 requires a minimum 4095
> 
> That said, both gcc and msvc will handle much larger
> string literals ( I tested up to 8000 ).

Did you build these strings literally, as:

".....  ...  ......"

or:

"............" \
"........" \

etc.?

Or, were they composed of various constants,
expressions, literals, etc. pieced together?

(i.e. I am curious as to how much strain you put
on the preprocessor's line lengths, etc.)

Thanks!
--don

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the tfug mailing list