IRC logs for #openttd.dev on OFTC at 2016-12-25
⏴ go to previous day
04:01:57 *** Supercheese has joined #openttd.dev
04:01:57 *** ChanServ sets mode: +v Supercheese
08:27:11 *** adf88 has joined #openttd.dev
08:27:11 *** ChanServ sets mode: +v adf88
09:05:30 *** Supercheese has left #openttd.dev
12:03:27 <adf88> I have few minor patches
12:03:46 <adf88> if you want to "waste" some Christmas time for OpenTTD then take a look :)
12:04:13 <adf88> fisrt one is to silence "IsVariableSizeRight defined but not used" warning
12:04:25 <adf88> when compiling with --enable-debug=0
12:04:46 <adf88> being more precise, when compiling with assertions
12:06:36 <adf88> (sorry, not "with", but "without" assertions)
12:07:11 <adf88> (the warning appears when compiling with --disable-assert)
12:08:05 <adf88> silences "attempt to free non-hep object" warning
12:09:26 <adf88> since "-Wfree-nonheap-object" is re-enabled
12:14:03 <adf88> adds limit to drag-drop placing waypoints
12:14:33 <adf88> so this is no more possible to highlight more then "station_spread" settings
12:14:38 <adf88> just like in case of stations
12:15:32 <adf88> currently if you select too much when placing waypoints you only get "empty" error
12:15:57 <adf88> like: "Can't place rail waypoint here..." (no detailed message)
12:22:57 <adf88> btw, there is an interesting bug about clipping
12:22:57 <adf88> and I have a proposal how to fix it
12:46:57 *** TheIJ has joined #openttd.dev
13:52:38 *** frosch123 has joined #openttd.dev
13:52:38 *** ChanServ sets mode: +v frosch123
14:02:16 <frosch123> ah, so the non-heap warning is only triggered when assertions are disabled
14:02:28 <frosch123> i think we should just disable it again
14:02:44 <frosch123> adding the funny cast only creates confusion
14:07:03 <adf88> another possible solution is to disable the warning only loacally
14:07:23 <frosch123> that only works with very recent gcc iirc
14:07:34 <frosch123> the compile farm does *not* run very recent gcc
14:07:39 <frosch123> so it will likely break stuff
14:07:59 <adf88> no, it's not that recent
14:08:06 <frosch123> and tbh i never encountered a bug where someone tried to free a nonheap object :)
14:08:36 <adf88> this warning is not much helpful
14:09:27 <adf88> I can live without it :)
14:10:53 <frosch123> the #ifdef WITH_ASSERT does not work for me
14:11:01 <frosch123> apparently it is not defined
14:12:26 <frosch123> hmm, i wonder what OTTD_ASSERT is
14:15:24 <adf88> sorry, I forgot about it
14:19:58 <adf88> I'm wandering, is this second "ifdef" neede?
14:20:29 <frosch123> i just did it the same way as in pool_func.hpp
14:22:49 <adf88> i don't know, it's better to assume that it is required
14:27:00 <adf88> theoretically compilers should not interpret what's inside the "assert" macro when NDEBUG is defined but this is only hypothesis
14:34:04 <adf88> what do you think about this
14:41:45 <frosch123> no idea, Rubidium and SmatZ always cared about that stuff :)
14:51:33 <adf88> the purpose of the above patch is to make sure that "assert" macro is an empty macro
14:52:29 <adf88> so you don't have to put "#ifdef OTTD_ASSERT" around "assert(something_not_defined)"
14:58:18 <adf88> don't enable -Wno-narrowing
14:58:40 <adf88> only -Wfree-nonheap-object
14:59:38 <adf88> it's enabled in MSVC and it should be enabled in GCC too
15:04:35 <adf88> you did not enable "Wno-narrowing"
15:05:12 <adf88> just ignore my last sentences
15:05:26 <frosch123> all those compiler versions are hell confusing :)
15:06:04 <adf88> that's the cost of being multiplatform
15:18:00 *** adf88 has joined #openttd.dev
15:18:00 *** ChanServ sets mode: +v adf88
16:00:20 <frosch123> the drag method was also used later down to decide the waypoint build axis
21:37:58 <Rubidium> compiler versions have nothing to do with being multiplatform
21:41:28 <Rubidium> regarding the IsVariableSizeRight, I guess that function should be put in #ifdef NDEBUG and the call (in assert can remain)
21:42:04 <frosch123> it's now in OTTD_ASSERT
21:42:10 <Rubidium> OTTD_ASSERT is a bit of a freak thingy
21:42:11 <frosch123> which fits what is used in pool_func
21:43:25 <Rubidium> I'm actually wondering why it's done that way
21:47:21 <frosch123> it was added in r22041, just for the pool_func stuff
21:51:24 <frosch123> my irc logs do not start early enough on that day, so can't tell
22:00:07 <Rubidium> can't find anything useful on that day, but the patch is related to the one in FS#4468
22:04:45 <Rubidium> okay, the the third version of the patch for that bug has assert(checked != 0); #ifdef OTTD_ASSERT this->checked--; #endif
22:06:20 <Rubidium> and I said I would put the ifdef before the assert, but that was (probably) rather because those belong together and it makes little sense to have code in outside #ifdef that references a variable that is only valid when that #ifdef is true
22:06:43 <Rubidium> so yeah, I guess the same "logic" applies to IsVariableSizeRight as well
22:10:27 <LordAro> assert(checked-- != 0) wouldn't be undefined, i think?
22:12:05 <Rubidium> probably right, but who knows how assert is actually implemented
22:12:19 <LordAro> sanely, one would hope
22:12:52 <Rubidium> any developer should irk when seeing modifications being done in an assert
22:13:11 <LordAro> true, but it's no different to what's there currently
22:13:40 <Rubidium> mostly because assert is a macro and therefor it won't be executed when asserts are disabled, but not all valid good is maintainable
22:18:29 <Rubidium> I regularly could write valid things in short manners, but still write it the long and possibly slightly less efficient way because to remains more maintainable that way. In here you could have claimed that check is only valid with OTTD_ASSERT, but that's not strictly the same as NDEBUG. In this case the count would remain in certain cases where the wasn't necessarily debugging
22:18:53 <Rubidium> it's a stupid configuration, but technically possible
22:30:44 <LordAro> i guess the next question is, can the code be rewritten to not need it?
continue to next day ⏵