Questions tagged [standards-compliance]
400 questions
0
votes
1 answer
GCC 4.5 C++0x forward compliance to C++11
I have a requirement to use GCC 4.5.x on a large project. I am trying to interpret the following statement on this page:
Important: GCC's support for C++11 is still experimental. Some
features were implemented based on early proposals, and no…

ThomasMcLeod
- 7,603
- 4
- 42
- 80
0
votes
1 answer
Pointer address standards-compliant conversion
I need to find the most standards-compliant way to obtain the address of a pointer and store its bytes separately (for instance, to transmit them serially).
I have two versions below, the first one which contains, I believe, undefined behavior, and…

anol
- 8,264
- 3
- 34
- 78
0
votes
3 answers
Verifying code against template patterns using reflection
I am working on a large project where a base class has thousands of classes derived from it (multiple developers are working on them). Each class is expected to override a set of methods. I first generated these thousands of class files with a code…

Raheel Khan
- 14,205
- 13
- 80
- 168
0
votes
3 answers
Why are JS scripts usually place in the header of a document?
Why are JS scripts usually place in the header of a document? Is it required by standards, or is it just a convention with no particular reason?

waiwai933
- 14,133
- 21
- 62
- 86
0
votes
1 answer
How can I insert column comments through a Standard SQL script?
I want a script that inserts table comments and column comments. Said script must be unique and run satisfactorily both on Oracle and MySQL. Furthermore, I prefer it to be written in Standard SQL.
This is how I do it now. But it does not work on…

Josep
- 495
- 2
- 6
- 16
0
votes
1 answer
Rounding error of std::cbrt?
I wonder if the following should be reported as a bug in gcc implementation of standard library.
For all unsigned integers i, if we compare int(std::sqrt(i)) to the actual square root of the integer, the conversion always give the good result. If we…

Vincent
- 57,703
- 61
- 205
- 388
0
votes
2 answers
HTTP server not to support persistent connections
is it possible for an HTTP/1.1 server not to support persistent connections and still be HTTP-compliant?

AComputer
- 519
- 2
- 10
- 21
0
votes
1 answer
How to make facelets conform to XHTML 1.0 Transitional?
Why can't facelets XHTML files be valid XHTML 1.0 Transitional files?
If I submit a facelet file in an xml validator (e.g. w3c validator) it shows an error on the first tag defined in one of the taglibs.
Example 1:
If I submit the following file to…

Pierluigi Di Giacomo
- 31
- 1
- 5
0
votes
6 answers
Self logical and?
The answer may be obvious for some of you, but as I can't find the answer, I need to ask it.
Oftenly, if a function has to return whether all was executed without problems, I use a boolean that track any failure.
bool myFunction()
{
bool ok =…

Vincent
- 57,703
- 61
- 205
- 388
0
votes
2 answers
Non-const used in a constexpr : what does the standard say?
What does the C++11 iso standard say about such an expression :
class MyClass
{
public:
constexpr int test()
{
return _x;
}
protected:
int _x;
};
_x is a non-const used in a constexpr : will it…

Vincent
- 57,703
- 61
- 205
- 388
0
votes
2 answers
Are "hTTp/1.0" and "htTP/1.1" case-sensitive?
In 2002, Roy Fielding states that HTTP version should be case-sensitive in an RFC errata:
Personally, I never had any intention that the "HTTP" be
case-insensitive, and I am not aware of any clients that send it
lowercase, nor any server that…

Pacerier
- 86,231
- 106
- 366
- 634
0
votes
2 answers
Is casting a const char array to an integer in the header always safe?
Ignoring how repulsive and hacky it is, is the following guaranteed to be safe? If not, why?
//.h
struct foo
{
const static intptr_t KEY = (intptr_t) "VALUE";
};
//.cpp
void useFoo()
{
const char * value = (const char *) foo::KEY;
…

tgoodhart
- 3,111
- 26
- 37
-1
votes
1 answer
how can I execute a string formatting with out using exec function in python
I have an exec statement to set the formatting of two variables in python 3.6. Even though the code works fine, I need to change this due to compliance issue. Please let me know how it can be done differently.
My statement:…

adusur
- 1
- 2
-1
votes
1 answer
Why C compiler validation suites themselves may use the C standard library if the C standard library is actually under test?
How it is possible for C compiler validation suites to use any feature of the C standard library if the C standard library is actually under test and may be buggy (which invalidates the validation suite itself)?
For example, the suite may use itself…

pmor
- 5,392
- 4
- 17
- 36
-1
votes
2 answers
Shall a #pragma leading to nonstandard behavior cause __STDC__ macro not to be defined to 1?
Simple question: shall a #pragma leading to nonstandard behavior cause __STDC__ macro not to be defined to 1? (Does the C standard explicitly prescribes that? If yes, then in which section? If no, then why?) Reason of the question: see below.
Sample…

pmor
- 5,392
- 4
- 17
- 36