Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-24303

Code fails to compile without gnu99 flag

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • Installation (I)
    • None
    • RHEL7 docker build environment. Commit 23666eb2 and 44dae431 introduces the errors. gcc 4.8.5.
    • Support backlog

      The compiler complains and fails trying to compile `algodefs.c` unless `--std=gnu99` is added on the command-line to make.  8 other files in that directory were modified by the specified commit (see "Environment"), which actually removed the correct code and made it less correct. 

      ```
      algodefs.c:200:2: note: use option -std=c99 or -std=gnu99 to compile your code
      algodefs.c: In function 'zbx_isqrt32':
      algodefs.c:231:2: error: 'for' loop initial declarations are only allowed in C99 mode
        for (int i = 0; i < 16; i++)

      ```

      Note: `--std=c99` fails BSD-specific parts of the code. 

            zabbix.dev Zabbix Development Team
            otheus Otheus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: