Commit Graph

13 Commits

Author SHA1 Message Date
dependabot[bot] 6b6dfab10e Bump actions/checkout from 4 to 5 (#1073)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 08:49:09 -05:00
Patrick Grimm b9de08cf60 Feature/router bsd (#821)
* fix router compile warnings declaration-after-statement overlength-strings

* router disable PRINT(debug_level)

* ports rename dlmstp_[linux|bsd] to dlmstp_port

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* fix typedef in bip_get_local_address_ioctl

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* add bsd support for router app

* fix clang __attribute__ optimize dont work
clang O2/O3/Os are also not working

* fix pre-commit

* fix bsd SO_BINDTODEVICE is not available

* add brew install libconfig for app router and bsd

* fix BACDL_MSTP test on macOS

* remove old comments
2024-10-21 07:53:01 -05:00
Patrick Grimm 57c3b81bb1 enable BACDL_ETHERNET test for macOS linux and windows (#822) 2024-10-21 07:44:54 -05:00
Kari Argillander 9662a76ebd Make clean build with MSVC /Wall (#740)
* ci: Fix compile warning as errors was not correct

We want to enable warning as errors both Windows and Linux. This is
easiest to do with cmake option as -Werror does not work with MSVC. Also
it is self explaining what it does so no comment needed.

* dlmstp_linux: Fix -Wdeclaration-after-statement compiler warnings

Make dlmstp_linux C89/C90 combatible

```
/bacnet-stack/ports/linux/dlmstp_linux.c: In function ‘Timer_Silence’:
/bacnet-stack/ports/linux/dlmstp_linux.c:56:5: warning:
 ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   56 |     int32_t res;
      |     ^~~~~~~
/bacnet-stack/ports/linux/dlmstp_linux.c: In function ‘dlmstp_init’:
/bacnet-stack/ports/linux/dlmstp_linux.c:795:5: warning:
 ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  795 |     struct termios newtio;
      |     ^~~~~~
```

* Fix warnings produces by MSVC

Now that we have enabled /Wall for MSVC we get some warnings with it
which can be easily fixed.

We get following warnings:

```
src\bacnet\bacstr.c(223,39): warning C4127: conditional expression is constant
apps\router-mstp\main.c(1123,1): warning C4702: unreachable code
apps\epics\main.c(885,53): warning C4459: declaration of 'myState' hides global declaration
```

* cmake: Use /Wall with MSVC

Make MSVC to build cleanly with Wall. This might matter for some Windows
developers. And you never know if MSVC will find more bugs.

* cmake: Improve router build

Router build gives some warnings as it is not C90 compatible. It is ok
that example is not following C90 rules. Also it is annoing to new user
to build this cmake as first error usually is that libconfig is not
found. Let's just give warning about this so first build will usually go
smoother.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2024-08-22 07:50:20 -05:00
Kari Argillander dab6d8af55 Build more code in CI (#725)
* bugfix/hostnport: Fix bacnet_fdt_entry_from_ascii() parse wrong
* apps/router: Fix Wstrict-prototypes compiler warnings
* apps/router: Fix -Wmissing-field-initializers compiler warning
* ports/linux: Fix -Wself-assign compiler warning
* ports/linux: Fix -Wunused-function compiler warning
* Fix -Wimplicit-function-declaration warnings
* ci: Add more compile options to enable more code build
* ci: Do not fail-fast our main matrix build
* cmake: Add -Wno-c99-extensions compiler option

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2024-08-15 11:20:10 -05:00
Kari Argillander 6271632944 Add and fix compiler warnings (#718)
* Add and remove compiler warning compile options

Add some new compiler warnings. Some of those does not build clean so
ignore them for now. This also helps if some user use those options so
we ignore those for them also.

Also remove following ignores as they do not produce any warnings:

  - Wno-attributes
  - Wno-long-long
  - Wno-implicit-fallthrough

* Fix -Wmissing-declarations compiler warnings

Fix new -Wmissing-declarations compiler warnings. I tried to look which
should be in headers and which should be static. Might be that some
statics should be in header as it is not easy to choose if something
should be exported or not.

* Fix -Wmissing-field-initializers compiler warnings

If we use { { 0 } } compiler thinks we might have mean that we only
meant initialize first member of struct or have forgotton to add second
one. We could do { { 0 }, 0 } but we can just do { 0 } which tells
compiler that hey just intialize this whole thing to zero.

* tests: Fix couple -Wfloat-conversion warnings

Add f prefix to floating point numbers to get some double to float
warnings away.

* ci: Make warnings as errors with cmake main build

To keep repo more clean from warnings use Werror flag when building main
project.

Windows should need -DCMAKE_C_FLAGS="/WX" but we have not ignore errors
for that yet so let's not yet take it in use.

* ci: Build also tests in matrix build

Enable also tests to be builded in our main matrix build. This way tests
will be builded also with clang and in future also with MSVC. We also
keep build very clean now as all warnings as catched.

With this we can also take out -Werror from compile_options as we add
that in CI. It is not good practice to keep that option always on. It
makes development lot harder. See example this blog post [1].

[1]: https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/

* getevent: Deprecate getevent_encode_apdu()

Steve suggested that we should deprecate getevent_encode_apdu() [1].

Suggested-by: Steve Karg

[1]: https://github.com/bacnet-stack/bacnet-stack/pull/718#discussion_r1715821735

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2024-08-13 16:32:44 -05:00
dependabot[bot] bc8c261153 Bump actions/checkout from 3 to 4 (#484)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 13:53:52 -05:00
dependabot[bot] 2843b2b075 Bump actions/checkout from 2 to 3 (#329)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-24 11:35:08 -05:00
Steve Karg c3a4c229fe Issue 87 execute tests with GitHub ci (#234)
* Enable lcov coverage in unit testing via cmake.

* fix pipeline build error

* add compile options for unit test to silence some warnings

* remove all BAC_TEST unit tests in src/bacnet/ folder. They are now in test/bacnet/ folders using ztest.

* removed key.c - only used for unit test.

* produce XML test result output for parsing

* produce junit XML test result output

* change lint workflow to quality

* update readme badge for quality results

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-28 20:09:46 -06:00
Steve Karg 810a2f93de Feature/write property type check refactor (#182)
* refactor write-property tag check

* modify ports objects to use write-property tag check API

* modify example objects to use write-property tag check API

* Fix object unit test builds

* Fix and run unit ztests via CMake

* Enable unit testing on Travis CI

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-06-23 10:10:12 -05:00
Carlos Gomes Martinho 3818f3d844 ci: run pipeline also on pull requests (#88) 2020-05-18 11:04:34 -05:00
Carlos Gomes Martinho 5d4358030a ci: add mac os to github ci (#51)
* ci: add mac os to ci

* ci: add appveyor file
2020-02-19 10:48:36 -06:00
Carlos Gomes Martinho d3014c87fa build: improve cmake, add github actions (#16)
* build: install cmake config files to enable cmake find_package

fix: destination for header files

build: clean up build system

build: also install port directory header files

build: fix name of header files

ci: add github actions

build: add bsd port

chore: fix typos

build: remove not deeded mstpsnap

ci: disable ctests as not corrently

ci: disable macos for the moment

build: print compiler versions in cmake

* build: do not build apps by default

* build: add missing slash

* build: add more options to cmake (#3)

* build: add more options to cmake

* chore: disable ipv6

* build: guard around apps for options

* build: fix link lib on windows
2020-01-14 23:25:41 -06:00