libera/#maemo/ Saturday, 2021-11-20

sunshavi_It works for me. Even I do not have modem04:39
joergwell, echo "at+cfun=0"| pnatd - no need for nifty python. or simply pnatd; type "at+cfun=0<enter>" then close terminal or try ^C09:13
joergI'm not sure a stop sscd && stop csd is really useful. Basically best bet would be flight-mode09:15
joergrather tablet-mode09:15
joerg[5 Nov 2021 19:25:38] <joerg> you killed your DMM or your N900. The circuitry in N900 as well as the circuitry in a legit Nokia BL-5J battery forbids charging to anything >4.3V09:18
joerg*sigh*09:19
DocScrutinizernot sure if ...09:20
joerg...maybe that's the problem?09:21
joergsicelo: what tells zzztop?09:22
KotCzarnyanyone had a problem with gcc10 and ovewriting functions?12:22
MaxdamantusKotCzarny: you mean where gcc fixed its linkage bug that lots of code was making use of?13:31
Maxdamantusgcc used to allow multiple compilation units to declare the same symbol, without using extern.13:33
Maxdamantushttps://gcc.gnu.org/gcc-10/porting_to.html#common13:34
KotCzarny-fcommon fixed my problem13:39
KotCzarnything is, i'm overwriting funcion name depending on things13:39
KotCzarny*function13:39
KotCzarnyand sometimes it got proper address and sometimes it was null13:40
KotCzarnywith -fno-common default in gcc10 it was kind of random behaviour13:41
KotCzarnyhow do i declare function extern ?13:42
KotCzarnyits not about variable, but function13:42
MaxdamantusHmm.. Presumably you'd be getting a linkage error when not using -fcommon, rather than getting some random behaviour.13:44
KotCzarnyno, it linked ok13:45
KotCzarnyjust was incosistent behaviour, depending which function called that overloaded function13:45
KotCzarny(overloaded is not the right word but eh)13:45
KotCzarnyin particular example:13:46
KotCzarnyvoid (*oscp_s_seek)(int a);13:46
MaxdamantusOkay, that's not a function. It's a pointer to a function.13:46
KotCzarnythen i'm setting address of that function13:46
KotCzarnyand when called, sometime function is set properly, sometimes a null13:46
MaxdamantusRight, so only one compilation unit should have what you wrote above. The other compilation units should declare it extern.13:47
KotCzarnyhow do i declare function extern?13:47
Maxdamantusextern void (*oscp_s_seek)(int a);13:47
KotCzarnyand no, i'm not redefining it anywhere13:48
KotCzarnyjust set during initialization of submodule13:48
KotCzarnyi'm doing that trick to avoid having bazillion of if/elses everywhere in the code13:49
KotCzarnyand no, i'm not defining/redefining oscp_s_seek anywhere else13:50
KotCzarnyjust set the pointer during init13:50
MaxdamantusEach compilation unit that declares it using `void (*oscp_s_seek)(int a);` is trying to declare another variable.13:51
KotCzarnyi'm declaring it only in oscp-slave.c13:51
Maxdamantusbut you want them all to refer to the same variable, so it should only be declared like that in one compilation unit, and the other compilation units should just have it as an extern.13:51
KotCzarnyunless .h declarations matter13:52
MaxdamantusIn the .h file you should probably have it as extern.13:52
KotCzarnyin every .h file i saw functions without extern, although those were normal functions, not declared as (*name)13:53
Maxdamantuscompilation units that import the .h file can still read/write to that function pointer variable, it's just that the variable is only created in one compilation unit, probably in the .c file.13:53
MaxdamantusRight, it's different for functions. What you have is a variable, not a function.13:53
Maxdamantus(particularly, a variable that stores a pointer to a function)13:54
KotCzarnylets see if it compiles/works with extern13:59
KotCzarnyinteresting14:08
KotCzarnyadding extern indeed fixed the symbol visibility/sharing14:08
KotCzarnynow i have to rewrite my .h generator, heh14:08
KotCzarnyit's just a thing that i wrote .h wrong for all those years14:10
KotCzarny(and so everyone else)14:10
L29AhKotCzarny: are you still withholding the source code?14:25
KotCzarnynope14:25
L29Ahcouldn't find the VCS repo14:26
KotCzarnythere is no vcs of any kind14:27
KotCzarnyjust an aur package14:27
sicelo:-)14:40
sicelonice!14:40
L29Ahabsolutely disgusting14:44

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!