| View previous topic :: View next topic |
| Author |
Message |
Jean Pierre Daviau Guest
|
Posted: Sun Dec 03, 2006 12:25 am Post subject: bcc32 does not complains |
|
|
Hi everybody,
How do I set the compiler to a more strict behavior?
--
Thanks for your attention.
Jean Pierre Daviau
--
Easyphp1.8 with Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp |
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Sun Dec 03, 2006 12:58 am Post subject: Re: bcc32 does not complains |
|
|
You have not said what type of behavior you wish to be more strict so I can
only guess as to what you want. Try adding -w to the command line to the
left of all file names.
.. Ed
| Quote: | Jean Pierre Daviau wrote in message
news:4571c4eb$1 (AT) newsgroups (DOT) borland.com...
Hi everybody,
How do I set the compiler to a more strict behavior?
--
Thanks for your attention.
Jean Pierre Daviau
--
Easyphp1.8 with Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp |
|
|
| Back to top |
|
 |
Jean Pierre Daviau Guest
|
Posted: Sun Dec 03, 2006 1:07 am Post subject: Re: bcc32 does not complains |
|
|
char *tableau2[][2] = {{"allo", "World"},{"lo", "World"}};
printf("tableau2[1][2] : %s\n", tableau2[1][2]);
there is no place for tableau2[1][2];
"Ed Mulroy" <dont_email_me (AT) bitbuc (DOT) ket> a écrit dans le message de news:
4571ccaa$1 (AT) newsgroups (DOT) borland.com...
| Quote: | You have not said what type of behavior you wish to be more strict so I
can only guess as to what you want. Try adding -w to the command line to
the left of all file names.
. Ed
Jean Pierre Daviau wrote in message
news:4571c4eb$1 (AT) newsgroups (DOT) borland.com...
Hi everybody,
How do I set the compiler to a more strict behavior?
--
Thanks for your attention.
Jean Pierre Daviau
--
Easyphp1.8 with Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp
|
|
|
| Back to top |
|
 |
Jean Pierre Daviau Guest
|
Posted: Sun Dec 03, 2006 1:16 am Post subject: Re: bcc32 does not complains |
|
|
| for(; *++tableau[i] != NULL;) comparison between pointer and integer |
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Sun Dec 03, 2006 2:41 am Post subject: Re: bcc32 does not complains |
|
|
A warning there would not be correct.
The C and C++ languages specifically provide a basis for conversion between
and for comparison between a pointer and zero, a NULL pointer.
.. Ed
| Quote: | Jean Pierre Daviau wrote in message
news:4571d0f2 (AT) newsgroups (DOT) borland.com...
for(; *++tableau[i] != NULL;) comparison between pointer and integer |
|
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Sun Dec 03, 2006 2:44 am Post subject: Re: bcc32 does not complains |
|
|
This is not Delphi. Neither of C nor C++ offer range checking. C++ offers
vectors and the string class. Had you used a vector of strings and the 'at'
operator an error or exception would be generated.
.. Ed
| Quote: | Jean Pierre Daviau wrote in message
news:4571cee4 (AT) newsgroups (DOT) borland.com...
You have not said what type of behavior you wish to be more strict ...
char *tableau2[][2] = {{"allo", "World"},{"lo", "World"}};
printf("tableau2[1][2] : %s\n", tableau2[1][2]);
there is no place for tableau2[1][2]; |
|
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Sun Dec 03, 2006 2:46 am Post subject: Re: bcc32 does not complains |
|
|
In addition if you used C++ Builder instead of the downloadable version 5
command line tools subset, you could enable CodeGuard which should flag an
invalid memory access.
.. Ed
| Quote: | Jean Pierre Daviau wrote in message
news:4571cee4 (AT) newsgroups (DOT) borland.com... |
|
|
| Back to top |
|
 |
|