Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error in sunwait.cpp #37

Open
goverp opened this issue Aug 15, 2022 · 5 comments
Open

Syntax error in sunwait.cpp #37

goverp opened this issue Aug 15, 2022 · 5 comments

Comments

@goverp
Copy link

goverp commented Aug 15, 2022

Hi, thanks for this very useful piece of code that I've used for some time.
I've just cloned it onto my new Raspberry Pi and tried to run "make", and it fails in compilation in sunwait.cpp at lines 707 on, where the if statement has incorrect bracketing. I think it should be:

else if   (!strcmp (arg, "debug")           ||
              !strcmp (arg, "--debug")      ||
              !strcmp (arg, "--verbose")    ||
              !strcmp (arg, "-v"))           pRun->debug = ONOFF_ON;

If I trusted my C++ and git skills more, I'd send a pull request.

@petrjac
Copy link

petrjac commented Sep 11, 2022

Same issue when building as OpenWRT package:

...
/tmp/openwrt-sdk-22.03.0-mvebu-cortexa9_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/sunwait-1.0/sunwait.cpp: In function 'int main(int, char**)':
/tmp/openwrt-sdk-22.03.0-mvebu-cortexa9_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/sunwait-1.0/sunwait.cpp:707:47: error: expected primary-expression before '||' token
  707 |     else if   (!strcmp (arg, "debug"))        ||
      |                                               ^~
make[2]: *** [Makefile:42: /tmp/openwrt-sdk-22.03.0-mvebu-cortexa9_gcc-11.2.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/sunwait-1.0/.built] Error 1
...

Overcomed with exact version setting in Makefile:

PKG_SOURCE_VERSION:=102cb417ecbb7a3757ba9ee4b94d6db3225124c4

(Before problematic 22b741a commit)

@likemotion
Copy link

Trying to compile on RASPI Bullseye.

Excuse my ignorance, but I have placed the line cited above "PKG_SOURCE_VERSION:=102cb417ecbb7a3757ba9ee4b94d6db3225124c4"
after the line beginning "LDFLAGS..." in makefile and I get the same error as reported by "sebma".

makefile.txt

@petrjac
Copy link

petrjac commented Sep 12, 2022

@likemotion using the PKG_SOURCE_VERSION is valid only for OpenWRT specific makefile.

You could probably try clone the repository and then switch version:

git clone https://github.com/risacher/sunwait.git
cd sunwait
git checkout 102cb417ecbb7a3757ba9ee4b94d6db3225124c4
make

@likemotion
Copy link

likemotion commented Sep 12, 2022 via email

@petrjac
Copy link

petrjac commented Sep 12, 2022

Hi @likemotion

happy to hear that. This is only warnings from compiler.

You can run sunwait from current directory:

pi@raspberrypi:/tmp/sunwait $ ./sunwait help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants