Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > warning: string length greater than '509'

Reply
Thread Tools

warning: string length greater than '509'

 
 
Keith Thompson
Guest
Posts: n/a
 
      12-23-2011
Robert Wessel <(E-Mail Removed)> writes:
[...]
> But while C89/C90 has been officially superseded by C99 (or actually
> C11 as of a couple of weeks ago), there are a significant number of
> compilers in the world that have not fully implemented C99 (or any of
> C99) while still providing a full C89 implementation. MS's standard
> compiler falls into that category, for example, as do many compilers
> for embedded targets.

[...]

Which raises an interesting point. Since the 2011 ISO C standard
officially supersedes the C99 standard, both C90 and C99 now have
exactly the same status. They're both officially obsolete standards
that still have some level of support from current implementations.
(C90 happens to have more support than C99.)

I presume that no implementations yet support all of C2011. Are there
implementations that support some of the new C2011 features?

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
 
Jens Gustedt
Guest
Posts: n/a
 
      12-23-2011
Am 12/23/2011 09:21 PM, schrieb Keith Thompson:
> I presume that no implementations yet support all of C2011. Are there
> implementations that support some of the new C2011 features?


gcc 4.6 has some, nothing dramatic, but AFAIR there are:

- _Static_assert
- redefinitions of typedefs
- anonymous struct or unions are supported since long.
- Some features such as _Noreturn or _Allignas could probably just
be implemented as macros to some __attribute__

my guess would be that on POSIX systems the implementation of the
library side of threads and atomics could be realized quickly.

Jens
 
Reply With Quote
 
 
 
 
rudolf
Guest
Posts: n/a
 
      12-23-2011
In article <(E-Mail Removed)>,
Keith Thompson <(E-Mail Removed)> wrote:

> I presume that no implementations yet support all of C2011. Are there
> implementations that support some of the new C2011 features?

I would guess so, since the committee tends to standardize things that
are already implemented. (At least that's how I understand it)
 
Reply With Quote
 
JohnF
Guest
Posts: n/a
 
      12-24-2011
Robert Wessel <(E-Mail Removed)> wrote:
> JohnF <(E-Mail Removed)> wrote:
>> Robert Wessel <(E-Mail Removed)> wrote:
>>> JohnF <(E-Mail Removed)> wrote:
>>>
>>>> warning: string length '1008' is greater than the
>>>> length '509' ISO C90 compilers are required to support
>>>
>>> Compile with: -Wno-overlength-strings

>>
>>Who knew??? So I took a look at man cc and also found
>>-std=gnu99 which also works. Weirdly, though, -std=c99,
>>which seems equivalent as described on the manpage,
>>emits about a dozen new warnings, including some
>>"obviously wrong" (meaning they could be right?) ones
>>like "implicit declaration of function 'popen'", even
>>though stdio.h is included. (Note: I haven't actually
>>tested the executable images created using either switch,
>>and certainly not looked for any differences in the
>>generated instructions.)

>
>
> As others have pointed out, gnu99 leaves a bunch of commonly used GCC
> extensions enabled.
>
> A word about C99 mode (with or without extensions), though. If C99
> support is a reasonable prerequisite for the targets you're intending
> to port to (or if you're writing strictly for the local machine), by
> all means, go ahead and use that, there are certainly some useful
> additions to the language (and also a few changes).
>
> But while C89/C90 has been officially superseded by C99 (or actually
> C11 as of a couple of weeks ago), there are a significant number of
> compilers in the world that have not fully implemented C99 (or any of
> C99) while still providing a full C89 implementation. MS's standard
> compiler falls into that category, for example, as do many compilers
> for embedded targets.
>
> So if you intend a port to Windows, you'll have to use a compiler
> other than MSVC if you use C99 features. If I understand the
> situation correctly, Jacob Navia, who has posted in this thread, has
> produced such a creature, and would apparently be willing to sell you
> a license. The GCC ports for Windows should work too, as would
> Intel's ICC. But there are certainly some advantages to using MSVC
> for Windows development.


Thanks for the additional info. C89 should work fine for everything,
except the silly long string initialization. And although I usually
try to code in completely portable ansi standard C, this particular
program is pretty much Unix only. Maybe I should clarify, it's the
gpl'ed program http://www.forkosh.com/mathtex.html that recently
got that silly long string due to the enhancement
http://www.forkosh.com/mathtex.html?valignment which vertically
aligns emitted images precisely ("middle" or "absmiddle" doesn't
usually do a decent job). And since it's a one-line build, I don't
provide any configure/make-type script, just instructions what to
put on the cc line. And I won't bother adding -std to that. But I
occasionally get email about -pedantic warnings from sticklers, and
so try to eliminate them when it's feasible and reasonably easy.
This time it apparently ain't, so the heck with it. The 4095 limit
pointed out by Jacob Navia is quite more than I actually need,
so there's no actual problem, just the pesky message. And I hoped
there might be a tricky way to easily accomplish the equivalent
initialization without raising the warning. But I'm not materially
changing the code just to deal with it.
--
John Forkosh ( mailto: (E-Mail Removed) where j=john and f=forkosh )
 
Reply With Quote
 
JohnF
Guest
Posts: n/a
 
      12-24-2011
Robert Wessel <(E-Mail Removed)> wrote:
> JohnF <(E-Mail Removed)> wrote:
>>
>>I usually try to code in completely portable ansi standard C

>
> If the command line option is an issue, there's an equivalent #pragma.


Yeah, I hate those kinds of constructs, which are nonportable by nature.
I usually try to (functionally) decompose a problem domain into two
subdomains: a computable function part, programmable a la Church's thesis
in any Turing complete language, and an environment/os-specific part
(usually i/o-related, or file/resource handling/locking-related, or
interprocess communication-related, or otherwise concurrency-related, etc).
And I try to minimize and isolate/sandbox the os-part as much as possible,
leaving the "business logic", and as much i/o as possible, completely
portable and reusable.
Anyway, that's getting way off-topic.
Thanks for your help,
--
John Forkosh ( mailto: (E-Mail Removed) where j=john and f=forkosh )
 
Reply With Quote
 
Patrick Scheible
Guest
Posts: n/a
 
      12-27-2011
Keith Thompson <(E-Mail Removed)> writes:

> Since the 2011 ISO C standard officially supersedes the C99 standard,


So, is there a new edition of Harbison and Steele in the works?

Thanks,

-- Patrick
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-27-2011
Patrick Scheible <(E-Mail Removed)> writes:
> Keith Thompson <(E-Mail Removed)> writes:
>> Since the 2011 ISO C standard officially supersedes the C99 standard,

>
> So, is there a new edition of Harbison and Steele in the works?


I have no inside information on that, but the web site
<http://careferencemanual.com/> hasn't been updated since 2006-08-14.

But there is an e-mail address for the author.

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Patrick Scheible
Guest
Posts: n/a
 
      12-27-2011
Keith Thompson <(E-Mail Removed)> writes:

> Patrick Scheible <(E-Mail Removed)> writes:
>> Keith Thompson <(E-Mail Removed)> writes:
>>> Since the 2011 ISO C standard officially supersedes the C99 standard,

>>
>> So, is there a new edition of Harbison and Steele in the works?

>
> I have no inside information on that, but the web site
> <http://careferencemanual.com/> hasn't been updated since 2006-08-14.
>
> But there is an e-mail address for the author.


If a couple of days goes by and nobody here volunteers an answer, I'll
send him an e-mail. Thanks!

-- Patrick
 
Reply With Quote
 
Nick Keighley
Guest
Posts: n/a
 
      12-28-2011
On Dec 23, 12:52*pm, jacob navia <(E-Mail Removed)> wrote:
> Le 23/12/11 11:49, pete a crit :


> > The number (509) appears more than once
> > in the C90 standard
> > in a related context.

>
> > ISO/IEC 9899: 1990

>
> That is not the C standard, it has been obsoleted by the standard of
> 1999 where the enviromental limits have been increased to more
> reasonable values.


C89/90 is still the most portable standard
 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      12-28-2011
On 12/28/2011 06:27 AM, Nick Keighley wrote:
> On Dec 23, 12:52�pm, jacob navia <(E-Mail Removed)> wrote:
>> Le 23/12/11 11:49, pete a �crit :

>
>>> The number (509) appears more than once
>>> in the C90 standard
>>> in a related context.

>>
>>> ISO/IEC 9899: 1990

>>
>> That is not the C standard, it has been obsoleted by the standard of
>> 1999 where the enviromental limits have been increased to more
>> reasonable values.

>
> C89/90 is still the most portable standard


Do you still keep the length of your identifiers within the
corresponding environmental limits from C90?
--
James Kuyper
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Include header files in quotes or less-than greater-than signs? Dwight Army of Champions C++ 4 03-17-2010 06:39 PM
string size greater than page size? lazy C Programming 3 04-27-2007 01:42 PM
regex problem: 'greater than' 'less than' and 'equals' not matching! falcon Java 10 02-24-2006 01:23 PM
ServerVariables("LOGON_USER") reports a length greater than the characters displayed Ryan ASP .Net 1 01-19-2006 06:23 PM
negative number evaluating greater than string.size() Jason C++ 25 02-22-2004 08:43 PM



Advertisments