libnano / primer3-py

Simple oligo analysis and primer design
https://libnano.github.io/primer3-py
GNU General Public License v2.0
157 stars 43 forks source link

fix c99 limit building problem #119

Open liuxiawei opened 1 year ago

liuxiawei commented 1 year ago

In my server, I found some problem Looklike 图片 I fix it, hope it help! Thank you to the developers of libnano for creating this software.

benpruitt commented 1 year ago

Thanks for the PR -- primer3-py doesn't support C89 and a C99 compliant compiler should be okay w/ variable declarations in for loop control expressions [1, 2]. It looks like you have a custom build script -- you might want to make sure that the script and build environment are properly setting compiler flags. (also as an aside, we don't support / test with Python 3.7 [which is EOL], so outside of this specific concern, YMMV).

Btw -- looks like your compiler isn't running in C99 mode despite the flags in your screenshot image

liuxiawei commented 1 year ago

Oh no, it looks just like this. What I hope to solve is the problem that incompatible variable declaration syntax. To support C99, it shold look like

int i;
for(i =0; i.......)

not for(int i = 0)

benpruitt commented 1 year ago

It's desirable for the loop control variable to be locally scoped. Variable declaration in the loop control expression is C99 compliant. My point above is that the translation of your screenshot indicates that your compiler is not running in C99 mode (i.e., it is running in C89 mode and thus flags the control expression variable declaration as an error).