Debian Bug report logs - #339683
always (incorrectly) prints trailing whitespace

version graph

Package: mcpp; Maintainer for mcpp is Kiyoshi Matsui <kmatsui@t3.rim.or.jp>; Source for mcpp is src:mcpp (PTS, buildd, popcon).

Reported by: Daniel Stone <daniels@debian.org>

Date: Thu, 17 Nov 2005 23:03:35 UTC

Severity: normal

Tags: patch, wontfix

Found in version mcpp/2.5-1

Forwarded to kmatsui@t3.rim.or.jp

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, NIIBE Yutaka <gniibe@fsij.org>:
Bug#339683; Package mcpp. (full text, mbox, link).


Acknowledgement sent to Daniel Stone <daniels@debian.org>:
New Bug report received and forwarded. Copy sent to NIIBE Yutaka <gniibe@fsij.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Daniel Stone <daniels@debian.org>
To: submit@bugs.debian.org
Subject: incorrect canonicalisation of all whitespace to TOK_SEP
Date: Fri, 18 Nov 2005 10:01:00 +1100
[Message part 1 (text/plain, inline)]
Package: mcpp
Version: 2.5-1
Severity: normal

mcpp seems to canonicalise all whitespace to TOK_SEP.  The code in
expand.c for dealing with TOK_SEP writes out a space, unless the
previous character was also TOK_SEP.  This means that:
'#define foo bar\n'
will expand to:
'TOK_SEP#defineTOK_SEPfooTOK_SEPbarTOK_SEP'
so, a line containing only 'foo', gets converted to 'bar ', because
the \n is also treated as TOK_SEP.

This breaks things very badly when xrdb uses mcpp; resources change
from 'Foo.bar:\t#123456\nBar.baz:\t#654321\n', to
'Foo.bar:\t#123456 \nBar.baz:\t#654321 \n' (note the extra spaces).
X colour lookups then fail, because it doesn't strip spaces.

The way I 'fixed' this in Ubuntu was to just always skip TOK_SEP, but
this means that:
'#define foo bar \n'
will expand 'foo' to 'bar', instead of to 'bar '.  I don't know if this
behaviour is either desired or correct, however.  So, if always calling
continue in the TOK_SEP case in expand.c is incorrect, then mcpp needs
to differentiate general whitespace from newlines.

Cheers,
Daniel
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, NIIBE Yutaka <gniibe@fsij.org>:
Bug#339683; Package mcpp. (full text, mbox, link).


Acknowledgement sent to Daniel Stone <daniels@debian.org>:
Extra info received and forwarded to list. Copy sent to NIIBE Yutaka <gniibe@fsij.org>. (full text, mbox, link).


Message #10 received at 339683@bugs.debian.org (full text, mbox, reply):

From: Daniel Stone <daniels@debian.org>
To: 339683@bugs.debian.org
Subject: patch, and clarification
Date: Fri, 18 Nov 2005 10:12:12 +1100
[Message part 1 (text/plain, inline)]
tags 339683 + patch
kthxbye

So it turns out that cpp also skips trailing whitespace:
'#define FOO bar \n'
turns 'FOO' into 'bar' with the cpp from gcc.  So I'd say that if it's
not *correct* behaviour (which it almost certainly is), then it's
probably expected. ;)

I've also attached a patch which implements this, and works.

Cheers,
Daniel
[foo (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Tags added: patch Request was from Daniel Stone <daniels@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Changed Bug title. Request was from Daniel Stone <daniel@fooishbar.org> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#339683; Package mcpp. (full text, mbox, link).


Acknowledgement sent to NIIBE Yutaka <gniibe@fsij.org>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #19 received at 339683@bugs.debian.org (full text, mbox, reply):

From: NIIBE Yutaka <gniibe@fsij.org>
To: 339683@bugs.debian.org
Subject: Bug forwarded
Date: Sat, 14 Oct 2006 18:21:29 +0900
forwarded 339683 kmatsui@t3.rim.or.jp
thanks

After packaging new release of 2.6.1, I have checked
that this bug has not yet been fixed.  So, I have
forwarded this bug report again, this time in Japanese
(my translation).  Hopefully, it will be fixed soon.
-- 



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#339683; Package mcpp. (full text, mbox, link).


Acknowledgement sent to NIIBE Yutaka <gniibe@fsij.org>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #24 received at 339683@bugs.debian.org (full text, mbox, reply):

From: NIIBE Yutaka <gniibe@fsij.org>
To: 339683@bugs.debian.org
Subject: Re: Bug forwarded
Date: Mon, 16 Oct 2006 17:27:47 +0900
tag 339683 + wontfix
thanks

The upstream auther said, it's not a bug, but a feature.
For use of xrdb, he recommended use of -@old option.
-- 



Tags added: wontfix Request was from NIIBE Yutaka <gniibe@fsij.org> to control@bugs.debian.org. (full text, mbox, link).


Noted your statement that Bug has been forwarded to kmatsui@t3.rim.or.jp. Request was from NIIBE Yutaka <gniibe@fsij.org> to control@bugs.debian.org. (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 30 22:16:14 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.