Guild icon
Teeworlds
IRC / bridge
One-way IRC channel bridge. If you want to be able to send messages to IRC, contact @Dune or @heinrich5991. https://www.teeworlds.com/?page=docs&wiki=rules/irc_rules
Between 2019-07-14 00:00:00Z and 2019-07-15 00:00:00Z
Avatar
@ChillerDragon use KISS paradigm
Avatar
ChillerDragon 2019-07-14 08:06:52Z
but where is defined what is simpler
08:07
i have openssl as a dependency in the script that starts my tw server xd
08:07
sounds pretty as simple as possilbe to me lol
Avatar
for me simple means "everyone can understand this"
08:13
if your code looks like everyone understand it, you did a good job
08:13
Teeworlds is in most parts understandable
Avatar
ChillerDragon 2019-07-14 13:18:20Z
can any1 send help n fixing the warning here https://github.com/teeworlds/teeworlds/pull/2178
(cherry picked from commit ddnet/ddnet@5d8a0dd) old: [5d278dc1][engine/mastersrv]: saving addresses [5d278dc1][datafile]: loading data index=4 size=73 uncompressed=152 [5d278dc1][datafile]: loading...
Avatar
I have written a simple program in C, which allocates memory for a string vector and then prints this. #include <stdio.h> #include <string.h> int main() { char str_a[20]; st...
Avatar
ChillerDragon 2019-07-14 13:25:48Z
i dont see how this helps :c
Avatar
then try this
13:29
I am using the strftime function for a project and I pass to it a user supplied string instead of a string literal. Being overly cautious I compile by passing gcc every warning flag and because I a...
Avatar
ChillerDragon 2019-07-14 13:30:07Z
i think i will just enforce format nospace everywhere
13:30
spaces are ugly anyways
13:30
i wanted to stay as close to ddnet as possible but guess im too nobo
Avatar
you need to add GNUC_ATTRIBUTE((format(strftime, 3, 0))) to the str_timestamp_format I guess
Avatar
ChillerDragon 2019-07-14 13:30:51Z
didnt i do?
13:31
oh 3 0
13:31
not 4 0
Avatar
no
13:31
I mean to str_timestamp_format, not str_timestamp_ex
Avatar
ChillerDragon 2019-07-14 13:32:00Z
but also that would differ from ddnet code :c
13:32
i wonder why its workin there
Avatar
it has some #pragama GCC diagnosticf ignored "-Wformat-nonliteral", apparently introduced by me 😦
Avatar
ChillerDragon 2019-07-14 13:33:05Z
i guess its not something we desire to have in tw code?
13:33
what about goign with nospace everywhere?
Avatar
you can put these in teeworlds code as well
13:33
or you can try to fix the warning (which I apparently didn't manage to do :/)
13:34
try with GNUC_ATTRIBUTE first, please
Avatar
ChillerDragon 2019-07-14 13:36:12Z
so on both of them?
Avatar
yep
Avatar
ChillerDragon 2019-07-14 13:36:23Z
k pushed lez see
Avatar
the number tells which argument is the format parameter
Avatar
ChillerDragon 2019-07-14 13:36:40Z
meh
13:37
13:37
so that didnt work
13:37
oh epic semicolon xd
Avatar
hmm
13:38
seems like you need to ignore the warning for the function
13:38
it doesn't make a difference when you declare the parameter to be a format string
13:40
check the ddnet source code for how to silence the warnings for these functions
13:40
but the GNUC_ATTRIBUTE is still good to keep
Avatar
ChillerDragon 2019-07-14 13:40:21Z
both?
Avatar
yes
Avatar
ChillerDragon 2019-07-14 13:40:37Z
but then we differ from ddnet :c
Avatar
ChillerDragon 2019-07-14 13:43:55Z
thanks! ❤
Avatar
this looks like magic to me
Avatar
the idea is that the compiler can tell you when you use the wrong format string
13:51
e.g.
13:51
dbg_msg("abc", "%s", 5);
13:51
for this, the compiler will tell you that you pass a number (5) when the format string indicates a string (%s)
13:52
it can do that, because we tell it (on dbg_msg): void dbg_msg(const char *sys, const char *fmt, ...) GNUC_ATTRIBUTE((format(printf, 2, 3)));
13:52
this means, to the compiler:
13:53
the function dbg_msg receives a format string in parameter 2, and the corresponding parameters in parameter 3 and onwards
13:53
the printf in there means that it receives a format string that looks like a format string for printf
Avatar
👍 thanks for the explanation ^^
Avatar
ChillerDragon 2019-07-14 13:54:01Z
yy i get the problem but idk how to solve it.
Avatar
this won't work on runtime i guess
Avatar
ChillerDragon 2019-07-14 13:54:27Z
But at least ddnet and tw are now the same and it shows no warnings and after merge i can finally see times in my logs 😃
Avatar
ChillerDragon 2019-07-14 13:55:04Z
heinrich real mvp as always ❤
Exported 62 message(s)