@tedu @wolf480pl Never mind I thought it was this, in which optimisation might avoid a segfault completely:
int bar(struct foo *p) {
int py = p->y;
if (!p) {
return 0;
}
return py;
}
@tedu @wolf480pl Never mind I thought it was this, in which optimisation might avoid a segfault completely:
int bar(struct foo *p) {
int py = p->y;
if (!p) {
return 0;
}
return py;
}
@tedu @wolf480pl My guess would be segfault, unless you optimise, in which case it'll put the calculation of py after the "if (!p)" thing and it'll work fine.
@wolf480pl @tedu I dunno about that. On older systems like DOS, *(int *)0 was valid and just read low memory.
@wolf480pl @tedu I don't think so. In fact I think I read an article saying NULL could be non-zero in certain implementations of <stdlib.h>! So properly you should do "if (p==NULL)" not "if (!p)".
@wolf480pl @tedu In the original C, NULL was just macro in <stdlib.h>, nothing more. C++ has "nullptr" which I believe comes with extra semantics.
For British citizens - you can sign this petition asking to stop companies disabling video games people have already bought.
#UK #gaming
https://petition.parliament.uk/petitions/702074/
@Inginsub 🔫🐵
Growing lettuce on the ISS.
#space #NASA
https://www.nasa.gov/missions/station/iss-research/space-gardens/
Noticing articles that are 90% introduction and then end with "So what do we know about <article title>? Well, it's still a mystery."
@splitshockvirus Do you only have one IP address to choose from?
@splitshockvirus Ah! I can see how that would be annoying, not sure how they expect people to work around that (other than having the ISP's technician install the router).
Cause for Orion heatshield cracks found.
#NASA #Moon #space
https://www.nasa.gov/missions/artemis/nasa-identifies-cause-of-artemis-i-orion-heat-shield-char-loss/
Analysis of inflation in the US over the last 4 decades. #economics
https://www.reuters.com/graphics/USA-ELECTION/INFLATION/jnpwjxkdavw/
To protect against hurricanes, build DOMED houses. #domed
https://www.bbc.com/future/article/20241010-these-domed-homes-in-florida-survived-hurricanes
Went to see the TJ-II stellarator at CIEMAT. #physics #fusion
A social network where pixels of vertical space is limited rather than character count.
In my local supermarket there's a "clock" on the wall that seems entirely decorative. I think it's just a cardboard picture of a clock that always reads 4:45pm.
That got me thinking that non-functional clocks are a sign of civilisational decay. The object without its purpose.
Once there was an elephant,Who tried to use the telephant—No! No! I mean an elephoneWho tried to use the telephone—
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.