Re: Bug#1099935: dnspython: autopkgtest regression on s390x: bad request

Colin Watson <[email protected]>
Newsgroups gmane.linux.debian.ports.s390
Message-ID <[email protected]>
On Wed, Mar 19, 2025 at 08:57:34AM +0000, Pranav P wrote:
>In a file called huff-tables.h in ls-qpack, some calculations where happening based on the following code:
>#if __BYTE_ORDER == __LITTLE_ENDIAN
>#define I(i,j) ((j<<8)|i)
>#else
>#define I(i,j) ((i<<8)|j)
>#endif
>Surprisingly when compiled with the c99 standards the #else part was getting executed while for gnu99 #if part was getting triggered.
>Writing some #ifdef statements it was found that __BYTE_ORDER and __LITTLE_ENDIAN were not defined when compiled with c99 and hence the macro evaluated to
>#if NULL == NULL
>which caused the little endian logic of the code to get executed.
>In little endian systems, this would not be an issue as either ways only little endian part of the logic will get executed.
>__BYTE_ORDER and __LITTLE_ENDIAN are defined in the header file endian.h in glibc.
>This header file is automatically included when compiling with gnu99 and not when compiling with c99(This was tested by preprocessing with both c99 and gnu99 with the -E flag passed to gcc).
>In the setup.py file of pylsqpack it is mentioned to adhere to c99 standards.
>So, adding <endian.h> header file to lsqpack.c file seems to fix the issue.

Ah yes, of course.  In the circumstances I think that's better than my 
patch, which I think would have broken (due to overcorrection) if 
<endian.h> happened to be included by something else.

>Please see if the attached patch is fine. I also am not aware of how to submit a patch. So, if the attached patch is all good, can you please guide me on how to submit the patch.

I think the best way to go is to send this as a pull request to 
https://github.com/litespeedtech/ls-qpack, and then figure out how to 
get pylsqpack upgraded upstream (though I can apply the patch to the 
Debian package, at least).

If you can make a pull request yourself, then that would be best, but I 
can send it upstream on your behalf if you aren't set up for that.  
Could you at least write a short commit message for your patch, and 
reference https://bugs.debian.org/1099935 somewhere in it for tracking 
purposes?

Thanks,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.