Comments (14)
Well, when I add -D_XPG6, error gone, but still has timeval issue:
cc -ggdb3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os -D_XPG6 -o endlessh endlessh.c
cc: Warning: Option -db3 passed to ld, if ld is invoked, ignored otherwise
cc: Warning: Option -Os passed to ld, if ld is invoked, ignored otherwise
"/usr/include/sys/resource.h", line 146: incomplete struct/union/enum timeval: ru_utime
"endlessh.c", line 152: (struct) tag redeclared: queue
"endlessh.c", line 419: warning: implicit function declaration: getline
"endlessh.c", line 566: warning: implicit function declaration: getopt
"endlessh.c", line 569: undefined symbol: optarg
"endlessh.c", line 569: warning: improper pointer/integer combination: arg #2
"endlessh.c", line 572: warning: improper pointer/integer combination: op "="
"endlessh.c", line 573: warning: improper pointer/integer combination: arg #2
"endlessh.c", line 580: warning: improper pointer/integer combination: arg #2
"endlessh.c", line 583: warning: improper pointer/integer combination: arg #2
"endlessh.c", line 586: warning: improper pointer/integer combination: arg #2
"endlessh.c", line 602: undefined symbol: optind
cc: acomp failed for endlessh.c
make: *** [Makefile:8: endlessh] Error 2
from endlessh.
from endlessh.
Oh, yeah. Thanks for remember me EXTENSIONS. ;) Forgot about it.
Now, any progress:
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -xO4 -D_XPG6 -D__EXTENSIONS__=1 -o endlessh endlessh.c
"endlessh.c", line 152: (struct) tag redeclared: queue
"endlessh.c", line 419: warning: implicit function declaration: getline
cc: acomp failed for endlessh.c
make: *** [Makefile:8: endlessh] Error 2
It seems queue is declared externally.
Yes, -Os is only opt flag in gcc/clang. In Solaris cc opt prefixes is -xOn, and they has different. -xO4 will correct.
from endlessh.
After some experimens and corrections with code (PR #17) working combinations found:
CC = cc
CFLAGS = -std=c99 -Wall -Wextra -Wno-missing-field-initializers -xO4 -D_XPG6 -D__EXTENSIONS__=1
LDFLAGS =
LDLIBS = -lsocket -lnsl -lrt
Just remains some warnings:
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -xO4 -D_XPG6 -D__EXTENSIONS__=1 -o endlessh endlessh.c -lsocket -lnsl -lrt
"endlessh.c", line 420: warning: argument #1 is incompatible with prototype:
prototype: restrict pointer to char : "/usr/include/iso/stdio_iso.h", line 220
argument : pointer to pointer to char
"endlessh.c", line 420: warning: improper pointer/integer combination: arg #2
"endlessh.c", line 420: warning: improper pointer/integer combination: op "!="
seems require cast with Oracle Developer Studio (early it shown strict requirements to pointer types and casts). :) Will dig.
from endlessh.
Warnings remains related fgets(), which is in stdio_iso.h as follows:
extern char *fgets(char *_RESTRICT_KYWD, int, FILE *_RESTRICT_KYWD);
from endlessh.
At least block
#ifdef __sun__
while (fgets(&line, len, f) != -1) {
#else
in PR#17 should be len as value, not as pointer. This reduces warnings to one:
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -xO4 -D_XPG6 -D__EXTENSIONS__=1 -o endlessh endlessh.c -lsocket -lnsl -lrt
"endlessh.c", line 420: warning: argument #1 is incompatible with prototype:
prototype: restrict pointer to char : "/usr/include/iso/stdio_iso.h", line 220
argument : pointer to pointer to char
"endlessh.c", line 420: warning: improper pointer/integer combination: op "!="
:)
from endlessh.
Fixed. Updated PR #17
from endlessh.
from endlessh.
I took a different approach with b1c1599. No need to worry about EXTENSIONS on the command line, it just sets it in the source. I also went with "fifo" instead of "v_queue". Lastly, note the special instructions in the README. Let me know if there's anything I missed. I only tested on OpenIndiana and OmniOS, and neither of those use the Sun's cc. Thanks!
Yes, this will much better. Will test again updated. Thank you!
from endlessh.
from endlessh.
SunOS khorne 5.10 Generic_150401-64
Release 1/13, latest patch.
Will check 9f4bdc1
from endlessh.
Note: -D__EXTENSIONS__=1 still requires, without get build error:
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -xO4 -o endlessh endlessh.c -lsocket -lnsl -lrt
"endlessh.c", line 70: undefined symbol: INET6_ADDRSTRLEN
"endlessh.c", line 70: can not declare variably modified type at file scope
"endlessh.c", line 460: undefined symbol: in6addr_any
cc: acomp failed for endlessh.c
make: *** [Makefile:10: endlessh] Error 2
Successfully built new code with CFLAGS = -std=c99 -Wall -Wextra -Wno-missing-field-initializers -xO4 -D__EXTENSIONS__=1 and LDLIBS = -lsocket -lnsl -lrt
from endlessh.
from endlessh.
Ah, so you're essentially running an operating system from 2005! That explains why you're completely missing some things. What happens if you change the feature test macro on the first line to: #define _XOPEN_SOURCE 600 Some research suggests this is required to get IPv6 definitions, and that _POSIX_C_SOURCE 200112L isn't quite enough.
Generally speaking, from 2013 :) 1/13 is latest point release and it's updated up to 2019 patch level. Imagine, it's still supported :)
NB: IPv6 supported by Sol 10, ever from release 5/05 :)
With macro #define XOPEN_SOURCE 600 is same like previous (all ok), if -D__EXTENSIONS_=1 specified.
from endlessh.
Related Issues (20)
- Systemd won't start HOT 3
- Adding a man page for the endlessh.conf options
- Log in local timezone HOT 3
- InaccessiblePaths=/run /var makes systemd service not start on Raspberry pi HOT 1
- Is it possible to run it on Debian 9?
- (code=exited, status=1/FAILURE) HOT 19
- no config after installing with apt HOT 5
- CentOS 8, not possible to autostart enablessh HOT 3
- [announcement] Multi-arch docker image by linuxserver.io released HOT 1
- can't start endlessh service "Failed at step NAMESPACE" HOT 3
- Logging - where? HOT 2
- Random message delay?
- Why not set a non-privileged user in systemd unit file? HOT 5
- Request for Pacstall Support HOT 1
- TCP v4 is not default HOT 2
- need way to define IP to bind/listen to. Port= is not sufficent HOT 2
- USR1 should output stats regardless of LogLevel
- setcap 'cap_net_bind_service=+ep' does not work HOT 1
- [Feature]: Add option to upload IP addresses to aggregators like AbuseIPDB
- i have a proble in pmta
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from endlessh.