Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Thank you for your feedback. How would you suggest that I should have responded to this issue instead? I agree that my response was authoritative, but I believe that is what was asked (the issue is seeking an authoritative “official” answer). And from the perspective of not wanting to break this person’s code (or anyone who stumbles upon similar advice), the authoritative “official” answer is an unequivocal no, “this is not supported”, as the name of the property states. Though, like I mentioned, we can’t really tell anyone what to do in their own code, so at best we can say what’s supported and what’s not.


sort by: page size:

I'm sorry, but your comment wasn't clear. What assumption am I making? I mean, I'm sure I made several, but which do you think needs to be evaluated/supported?

Can you clarify where it indicates it's supported i.e. which specific example? I re read and didn't see it myself, seems others are missing it.

To be fair I don't see it not being supported either by the examples.


> 1. It gives a range of 3 permissible options. If one of these "permissible" options is "you can do anything", what are the other 2 options doing on that list?

Before the list it clearly says, "behavior, [... when UB occurs elided ...], for which the Standard imposes no requirements."

How can it both impose no requirements, yet simultaneously impose a requirement that it come out of that list of three options?

> That this somehow (how?) means "I can do anything" is purely your interpretation.

Purely mine?

* https://devblogs.microsoft.com/oldnewthing/20140627-00/?p=63...

* https://blog.regehr.org/archives/213

* https://blog.llvm.org/2011/05/what-every-c-programmer-should...

* https://stackoverflow.com/questions/32132574/does-undefined-...

* https://en.wikipedia.org/wiki/Undefined_behavior#Examples_in...

* https://www.youtube.com/watch?v=ehyHyAIa5so

I must have an amazing number of sock puppet accounts.


Well, that's just stupid. Why not check for extended attributes, and if they aren't there, call it unsupported.

It may be widely supported but it's also nonstandard. You also have to use include guards anyway, so it's best to avoid pragma once altogether.

And as the article mentions, that doesn't always solve the problem.


It's essentially unknowable if anybody has produced code out there that is like this, but the point still stands that it is valid code.

If you want to uphold a commitment to backwards compatibility, you simply cannot extend your language in a way that might possibly change the behavior of valid-but-nonsensical code in the wild.


The article indicates its not officially supported, although it could be.

     Ian Lance Taylor replied that the behavior is 
     undefined, but so far stable. His suggestion was 
     to open a bug and request that this desirable (!!!)
     behavior be explicitly permitted.

Thanks, yes misunderstanding: agree should be a framework protection not something developer should be sprinkling over code.

You're right on one point: the standard is very explicit.

And because it is explicit—a fact you yourself just admitted—the fact that silent erasure of non-dead code is not a listed option in response to UB means that it is not allowed.


it seems reasonable that it didn't allow it before the language designers explicitly created a flag for it.

That doesn't mean some enterprising soul wasn't able to make it work, but it does mean it wasn't officially supported.


How so? "You acknowledge that X is not designed or intended for use in Y" is not a restriction on using X for Y: it's just telling you in no uncertain terms that the developers of X will not be helping you with any issues if it turns out you are using it for Y. This looks like the exact situation that OP is in, and that the Java provision is designed to guard against.

So, we have a "standard" which says that both behaviors should be supported, and there should be two different ways to express them, but explicitly declines to say which does what?

I'm genuinely not sure what purpose this particular standard serves, but it looks like it's not allowing people to write portable code...


Now, see, that worries me right there. Because its just something a code-review obstructionist would say. They probably wrote the guidlines too.

It doesn't matter how you do those simple things. Almost always. If a case arrises where it does matter and somebody uses the wrong one, then by all means bring it up. Otherwise, hit Approve and move on.


As long as it doesn't violate the spec, I'd look at actual performance results of it. I.e. if it interferes with usage or creates some kind of performance degradation for the applications, then it's indeed a problem. Otherwise this requirement should have been an explicit part of the spec.

I.e. I'd imagine if this is a real problem, there should be some RFC for the updated version of the API where this is prohibited or some requirements are added about how to control it.


Do you mean that it is contrary to your coding standard or merely not required. If it is contrary to the standard then he should stop doing it.

No, the spec leaves implementing it open. Something I'm trying to change as the behaviour in the spec is wrong.

> it is an inherent design issue

it would definitely be a design issue if the extension could only support a single index type, but Andrew already has plans to implement HNSW in 0.5.0:

https://github.com/pgvector/pgvector/issues/27


They're confusing a read-only property that can be overridden with one that's made final.

> it's not spec-compliant for servers to parse and interpret this data.

That's wrong. A lot of people just don't understand the difference between SHOULD and MUST when reading standards. The standard just says that you shouldn't rely on servers accepting it unless they tell you.

next

Legal | privacy