You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've encountered the most stupid thing ever: https://infosec.exchange/@kanashimia/113033538870920565
Because string constants such as VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME are defined using preprocessor you can concatenate them accidentally.
Maybe it would be appropriate to wrap them in a parenthesis.
Quoting from the post:
GCC doesn't warn you about string concatenations at all.
Clang has -Wstring-concatenation, but that doesn't work through defines.
So IDE based on clangd won't warn about it too.
If these strings were defined in parenthesis as # define FOO ("foo")
then such problems couldn't occur, you can't concatenate ("foo") ("bar").
Although not sure if that causes any other problems, maybe some people do rely on the ability to concatenate those strings?
Who knows.
Spec is written in a weird way where it contains quotes value=""VK_KHR_video_encode_queue"", I guess just for an easier C generation, but ideally this should be fixed just for C headers, it isn't appropriate to change the spec because of this and break other binding generators.
This is technically a breaking change at the headers API level, but do people really rely on this?
What other possible problems can wrapping string in () cause?
I just throw this out for thinking and laughs, overall the issue is minor and may be ignored, you decide.
The text was updated successfully, but these errors were encountered:
I'll take a look at tweaking the header generator script to do this and link it to this issue when ready - it may be a while. We'd like to get a little soak time with a sample header before actually pulling the switch on shipping a change like this, since while it seems benign, it's impossible to know what odd downstream uses people might be making of the headers.
Re the ", in retrospect we should have tagged the strings with a type attribute so the generator could add them. As with some other suboptimal choices in the XML, this is essentially impossible to change now because there are so many downstream consumers doing their own XML parsing and processing.
So I've encountered the most stupid thing ever: https://infosec.exchange/@kanashimia/113033538870920565
Because string constants such as
VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME
are defined using preprocessor you can concatenate them accidentally.Maybe it would be appropriate to wrap them in a parenthesis.
Quoting from the post:
Spec is written in a weird way where it contains quotes
value=""VK_KHR_video_encode_queue""
, I guess just for an easier C generation, but ideally this should be fixed just for C headers, it isn't appropriate to change the spec because of this and break other binding generators.This is technically a breaking change at the headers API level, but do people really rely on this?
What other possible problems can wrapping string in () cause?
I just throw this out for thinking and laughs, overall the issue is minor and may be ignored, you decide.
The text was updated successfully, but these errors were encountered: