Comments (3)
Presumably this is due to, -Werror=lto-type-mismatch
, but it's unclear how to address it (at least, unclear to me). p9main
here must (unfortunately?) emulate the behavior of main
in ignoring its arguments if they are not specified; hence the void p9main(void)
formulation. Short of doing a major revision to the source code, this is something that we'll have to figure out how to convince the compiler (or, rather, linker) of being explicitly acceptable.
from plan9port.
p9main
here must (unfortunately?) emulate the behavior ofmain
in ignoring its arguments if they are not specified; hence thevoid p9main(void)
formulation.
Do you mean accepting arguments and then just silently never using their values for any purposes?
from plan9port.
Not precisely.
In standard C, main
is special in that it can be declared several different ways. Notably, int main(int argc, char *argv[])
and int main(void)
are both legal; to my knowledge, no other C function is special-cased in the same way (variadic functions are different). The linker must obviously support this as a special case when warning about type mismatches.
The issue with Plan 9 C is that main
was declared to return void
(that is, have no return value); instead, main
is expected to call exits()
with a pointer to some status string (or nil
, usually just written as 0
). For plan9port, p9main
is basically a wrapper function that emulates the difference between main
in standard and Plan 9 C. However, plan 9 C continued to support the void main(void)
vs void main(int argc, char *argv[])
for the benefit of programs that take or do not take command line arguments. But the special case for "real" main
doesn't exist for p9main
, hence this error.
One wonders if there's a magic flag that would tell the linker, "ignore type mismatches for this particular function." If so, that's the simplest fix.
from plan9port.
Related Issues (20)
- O_LARGEFILE workaround broken on aarch64
- Seg. Fault with 9pserve on MacBook Pro M1 HOT 3
- nfs over tcp support for vnfs
- more threadmaybackground needed
- ACME: per-window environment variables HOT 2
- Unable to install on debian HOT 6
- devdraw: Cursor reverts to macOS default on MacBook with notch
- Cant use 9l -- ld cannot find -l9 HOT 4
- libbio brdline error handling
- sam: regexp match issue
- acme -a, on MacOS, is unresponsive after changing window size
- can't pass both -b/-c and -r to INSTALL
- can not build under gcc-less linux HOT 4
- 9pfuse not working on Mac OS Sonoma
- Belorussian link does not work HOT 2
- No pointer warping in acme in virtual Fedora 39
- Issue triage
- 9pserve: msize not optimal
- kcmp in cmd/sort.c conflicts with FreeBSD system header file HOT 1
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 plan9port.