-
Notifications
You must be signed in to change notification settings - Fork 331
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
error: defined but not used [-Werror=unused-function] #81
Comments
I'm preparing a package for debian and i've been biten by this just now |
I was supposed to be preparing the package for Debian, but please proceed... |
oh now i see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848138 but it's still marked as RFP (you sent a followup message as ITP but you forgot to retitle the original bug). do you have a package ready? i need this really quickly that's why i'm working on it but i can sponsor your work an/or comaintaing the package |
I was not sure how to change the title of the bug, this is not documented here: I'm more used to bug tracking systems with a user interface, such as Bugzilla. I must admit I find the learning curve of the Debian bug tracking system rather steep. |
I do have packages for Ubuntu 14.04 or 16.04. They seem to be properly packaged and working well. I would love to get them reviewed. Since I'm on Ubuntu, I tried building a Debian package using pbuilder. Again I find the learning curve rather steep: there are multiple documented ways for the most basic operations, I haven't found a straightforward and reasonably short manual yet - one that would explain how to easily run package building operations step by step, manually, to debug errors such as this one. That said I'm pretty sure this is a compiler bug, but I do want to open a bug report and work around the bug. Then I tried installing Debian in a VirtualBox VM instead of using pbuilder. Unfortunately there are known issues with installing Debian testing (or unstable). See for example: Right now I can provide Ubuntu packages, or the files that I have used to build the package. I would also like to add these files in a public version control system, but I haven't found a standard system for the control files of Debian packages yet, at least one I have access to. Could you suggest a server running a version control system? Is GitHub OK for that? |
yeah github is fine, please upload your package there please (quick version: create a source package, create a git repo, go in the repo, gbp import-dsc --pristine-tar /patch/to/file.dsc ; git push --all) i can handle the debian side (i'm a debian developer) |
anyway, the solution to this error is to ignore the warning (which are treated as error in debian on purpose):
|
Just created this git repo: Will attempt to populate it real soon. |
maybe adding a |
This looks like a compiler bug that will hopefully disappear in upcoming versions — I haven't experienced this bug with any recent Fedora or Ubuntu LTS release. It's probably better to work around the compiler bug in the package specific to Debian, rather than in upstream source code. Unless you were thinking of patching io.c in the Debian package, not upstream? |
If it is a generic bug in clang (in several, widely used versions) patching it upstream might make sense. But if the bug is specific to a specific clang version used in Debian, or even specific to the clang package on Debian, you are right. Then, it makes more sense to fix it in the Debian package. |
it is not a compiler bug, it is a debian decision to treat every warning as an error. |
The warning itself looks like a compiler bug, not the fact that Debian treats warnings as errors. Even when compiling with |
right. thread_id and lock_callback in fact are used. They are not called directly, but function pointers to them are handed over to openssl and clang doesn't recognize that and complains by mistake. |
@sandrotosi Can you give it a try? I'm not sure about By the way, I was able to build a sid binary using pbuilder after all, after adding |
Watching eagerly. If you get this working I'll see if I can make an Ubuntu ppa. |
I have a working build in Devuan now: https://git.devuan.org/devuan-packages/openfortivpn Note: I'm using source format "3.0 (git)" which isn't supported in Debian... no idea about Ubuntu, but just changing the debian/source/format to "3.0 (quilt)" should be sufficent as I haven't had to patch the upstream source for this build. |
@DimitriPapadopoulos the copyright file is really poor and misses a lot of the copyright/license notices. I have a working package, I'll polish it up, add you to uploaders, uploade it to collab-main git.debian.org repo and upload it |
@sandrotosi I did also wonder about the special exception in LICENSE for linking against libssl |
@DimitriPapadopoulos @Centuriondan i've just uploaded it to debian experimental (due to the upcoming freeze): repo at https://anonscm.debian.org/cgit/collab-maint/openfortivpn.git let's see what the ftp masters thinka bout the license. i'm also not sure if the binary should have the setuid bit set, as to setup the tunnel it requires root permissions |
@sandrotosi |
oh look at that - i just started looking at nm-fortisslvpn! ;) yeah that's why i'm unsure, we'll see when i played a bit with the NM plugin |
@sandrotosi - well if your working on it the nm-fortisslvpn plugin I will follow your work for Devuan ;-) |
@sandrotosi I also had a working package (perhaps with changes to apply to copyright) and I was supposed to package the software. Now my work has been discarded, you have used the fact that you're a Debian developer to push your own work, and I have disappeared from the copyright. |
@sandrotosi I too believe it's better not to have the setuid bit set. |
On Ubuntu |
Thanks for your work on this guys. About the setuid bit: I agree it is not needed and could be a security concern in case of a flaw in openfortivpn. In case this can be of any help, here is the spec file to build the Fedora / CentOS packages: https://src.fedoraproject.org/cgit/rpms/openfortivpn.git/tree/openfortivpn.spec |
Is there to the current date any workaround for using openfortivpn with debian testing?
|
@sandrotosi Can I help update the openfortivpn package in experimental to version 1.3.0 and perhaps apply change 9f8a6d65? |
@groovejunkk see the comment from @sandrotosi above: add
For the sake of completeness: current Ubuntu/17.04 (gcc 6.3.0 20170406) or openSUSE/Tumbleweed (gcc 6.3.1 20170202) systems are not affected, but Fedora 26 (gcc 7.1.1 20170503), Arch Linux (gcc 6.3.1 20170306) and Debian/unstable (gcc 6.3.0 20170516) still need that workaround to build. GCC #28901 discusses this warning too and someone suggested another workaround for that, although I can't tell if that's just papering over a real problem in the code: diff --git a/src/io.c b/src/io.c index a2b7710..72d1fae 100644 --- a/src/io.c +++ b/src/io.c @@ -52,14 +52,14 @@ typedef dispatch_semaphore_t sem_t; #define PKT_BUF_SZ 0x1000 static pthread_mutex_t *lockarray; -static void lock_callback(int mode, int type, char *file, int line) +static void __attribute__((unused)) lock_callback(int mode, int type, char *file, int line) { if (mode & CRYPTO_LOCK) pthread_mutex_lock(&(lockarray[type])); else pthread_mutex_unlock(&(lockarray[type])); } -static unsigned long thread_id() +static unsigned long __attribute__((unused)) thread_id() { return (unsigned long) pthread_self(); } With that applied, |
this would be an alternative to the solution with |
At this point, this looks like a Debian packaging issue. The |
I still think that marking certain variables with |
@ckujau See the comment from a packager in fc91349:
|
I am attempting to package openfortivpn for Debian. I get these error messages at compile-time:
It looks like the packaging environment forces
unused-function
compiler warnings into errors.The text was updated successfully, but these errors were encountered: