[
https://issues.apache.org/jira/browse/GUACAMOLE-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18020208#comment-18020208
]
Nick Couchman commented on GUACAMOLE-2136:
------------------------------------------
For the first issue, function prototyping, it looks like the requirement
(standard) is just to put the "void" keyword into any function that doesn't use
any arguments. I'm not sure what additional style direction would be required,
here - if we're going to be strictly compliant with C standards, we would need
to add that to all functions that don't have any arguments.
For the "set but not used" variable, we should definitely address that - I'm
actually surprised GCC doesn't catch this, it's pretty common for compilers to
identify those items these days. Looking at that bit of code, it looks like it
was added quite a long time ago, and I'm guessing just never got cleaned up
back when it was last modified 11 years ago.
> Enable building with clang compiler
> -----------------------------------
>
> Key: GUACAMOLE-2136
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-2136
> Project: Guacamole
> Issue Type: Improvement
> Components: guacamole-server
> Reporter: Stephen Schiffli
> Priority: Minor
>
> I tried building with clang and hit some minor errors.
> {{cc --version}}
> {{Ubuntu clang version 18.1.3 (1ubuntu1)}}
> Almost all of the errors are in the form of:
> {{error: a function declaration without a prototype is deprecated in all
> versions of C [-Werror,-Wstrict-prototypes]}}
> {{ 117 | void guac_argv_stop();}}
> {{ | ^}}
> {{ | void}}
> It appears the strict-prototypes rule is part of clang pedantic but not gcc.
> Obviously a few different ways to address this, but would be interested in
> the opinion of the maintainers for a style direction.
> The only somewhat interesting find was a "set but not used variable"
> {{surface.c:1898:9: error: variable 'flushed' set but not used
> [-Werror,-Wunused-but-set-variable]}}
> {{ 1898 | int flushed = 0;}}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)