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.