Groups | Search | Server Info | Login | Register
Groups > gnu.gnustep.help > #13
| Path | csiph.com!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!171.64.64.130.MISMATCH!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Fred Kiefer <fredkiefer@gmx.de> |
| Newsgroups | gnu.gnustep.help |
| Subject | Re: NSAssert and noescape? |
| Date | Mon, 5 Feb 2018 22:23:43 +0100 |
| Lines | 66 |
| Approved | help-gnustep@gnu.org |
| Message-ID | <mailman.8635.1517865834.27995.help-gnustep@gnu.org> (permalink) |
| References | <A4E4EBE0-8308-492F-A46C-5EA8340343F1@bignerdranch.com> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | usenet.stanford.edu 1517865835 23739 208.118.235.17 (5 Feb 2018 21:23:55 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | help-gnustep@gnu.org, Richard Frith-Macdonald <richardfrithmacdonald@gmail.com> |
| To | Aaron Hillegass <aaron@bignerdranch.com> |
| Envelope-to | help-gnustep@gnu.org |
| In-Reply-To | <A4E4EBE0-8308-492F-A46C-5EA8340343F1@bignerdranch.com> |
| X-Mailer | Apple Mail (2.3445.5.20) |
| X-Provags-ID | V03:K0:vzHAlUsgg24xhsiUrjyMPXGozDvtnGx2ZzMUmxoj5ILSKbP+tWX A8IWer0+9zbquC9jiYg2GvIsTPqFROTz7FE0I/kKc+uyvIFiXl487fYmL93KcmMlwVkj+uz 1LD+nxz9joXN6mhrkjhQUlhh90h9ElPQBJzn12EUy9F7dHQ5H4HQZCOKwLXd9b+k6s5mU0u 1ef7P322f8UGdyzdn0VZA== |
| X-UI-Out-Filterresults | notjunk:1;V01:K0:rBsuiXPMfDs=:aYyqr8o3bMBy2nZhp7qcNY KTxdiYkU4jyIwWwokxgl/YVDTN0eSHvWUz/KGHLJ/kyqmL0yzg8hfTuDhjPqpNe5ogPFQO/sp 72YPwKYUbLWzAg5kcV8f6rw0XgtMIeaAmD6jRnYMk+/twmAcX+ShActhfmrzA8iKHbjMawGf6 J7i9BBMLXje09h9L/fuLgod5vhF39YpRqvMdCoCR0laMufY0il0WzyeuNI5juIuY8GFGwZGuX EHU6lE5sQdaR1bmVDvRX9u/wzIHYKFShGcsbkDZPTCb2xwyypI1PweWecwbMeE5a4Q41yBtnG E8HhKswREKt/Sfr0qxAnmYvDpRNJeoLZqaMNSJgQOI31KvQFOV+PawVDRX3FT6BBKgZoHxWG7 q0DCWYATKMPv7T2rQ4CrxGhEYhk4FC5kf76rEE78hNPd+9vl5ufo3iWgneN/P0EXdju5yiMaE vm5RCa93sHUSLvIyFp4XzHEATh41a49l7Rc+HOhl27cb83fKwXDuOKfBP5upR0Gv1KZItGHT6 6VE+lG/yp+sb6XavtHvldP09jBirLuO5RZ8JXANlOm8RTr22COjxNfE7p12yPbIyMM4Z/CXN5 cl9kqgP16EoPFD/MeI3bRIba55kaxrGCGk5IlxfZ8nzS4UYqQC/UYMjmvfsMhovBwZqFD6R8Z kOAuEBADGU4M7lq3rtijkvnVXZAnXlm9FutWV6PX3qjRMe5lFynfv7FE8a9G3N0TS/VuU/XlX LGL8dsUr7ffvRcpuysz0/ZSrKsIL5I6shE2se4pybKZvhrzPexdwlTwnLw6UzCwBCONEiZYPL 6chjGuRtAwwjlSP5QUSiwLNdA50xXyatvxNHNHlGV4ZtrnoMsI= |
| X-detected-operating-system | by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] |
| X-Received-From | 212.227.15.19 |
| X-BeenThere | help-gnustep@gnu.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | Users list for the GNUstep programming environment <help-gnustep.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/help-gnustep>, <mailto:help-gnustep-request@gnu.org?subject=unsubscribe> |
| List-Archive | <http://lists.gnu.org/archive/html/help-gnustep/> |
| List-Post | <mailto:help-gnustep@gnu.org> |
| List-Help | <mailto:help-gnustep-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/help-gnustep>, <mailto:help-gnustep-request@gnu.org?subject=subscribe> |
| Xref | csiph.com gnu.gnustep.help:13 |
Show key headers only | View raw
Hi Aaron, thank you for this bug report. I really would like to hear more from your porting experiance > Am 05.02.2018 um 19:47 schrieb Aaron Hillegass <aaron@bignerdranch.com>: > > Hi, > > I’m porting the FMDB library to run on GNUstep on Linux: > https://github.com/ccgus/fmdb > > I’m getting errors with the vargs on NSAssert: > FMDatabase.m:1495:36: error: too many arguments provided to function-like macro invocation > NSAssert(false, @"%@", [self lastErrorMessage]); This first issue here is a bug in GNUstep base. It looks to me like it is easy to fix. But as I am no expert on the usage of variadic arguments in C macros, I would prefer for Richard to look into this. The problem is that the solution will have to work with different compilers and should still work when no extra arguments are given. The simplest and safest solutions I see is to rename the macro _NSAssertArgs to NSAssert in NSException and remove the old definition (and similar for NSCAssert). That way we keep the same tested code. Interestingly nobody ever noticed this issue before in the over 20 years of GNUstep. > /usr/local/include/Foundation/NSException.h:475:9: note: macro 'NSAssert' defined here > #define NSAssert(condition, desc) > > I’m also getting some warnings on noescape: > ./FMDatabasePool.h:199:36: warning: unknown attribute 'noescape' ignored [-Wunknown-attributes] > - (void)inDatabase:(__attribute__((noescape)) void (^)(FMDatabase *db))block; This is a clang issue. Your clang version seems to be too old to support this attribute. > Trivia for other who will come after me: I had to install libbsd and libdispatch. As a dumb work-around, I also defined some empty macros: > > #ifdef __linux__ > #define SInt32 int32_t > #define NS_SWIFT_NAME(the_name) > #define __deprecated_msg(the_message) > #endif > > Here’s how I’m building it: > clang -x objective-c -fconstant-string-class=NSConstantString -fPIC -fobjc-nonfragile-abi -fblocks -I/usr/local/include/ -c FMDatabase.m -o FMDatabase.o I would always suggest to write a GNUmakefile even when a project is very small. That way you don’t have to fiddle with the compiler parameters yourself. Cheers Fred
Back to gnu.gnustep.help | Previous | Next | Find similar
Re: NSAssert and noescape? Fred Kiefer <fredkiefer@gmx.de> - 2018-02-05 22:23 +0100
csiph-web