bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-indent] indent mangles trigraphs


From: anton . peters
Subject: [Bug-indent] indent mangles trigraphs
Date: Thu, 16 May 2002 17:14:34 +0200

L.S.:

Indent destroys trigraphs, like:
"??(" for '[' and "??)" for '] ',
by putting spaces before the question marks and opening parenthesis.
I need trigraphs because OS/390 doesn't know brackets.

e.g.:
===================================================================
$ cat tstf3.c
{
    MQCHAR cChannelName??(MQ_CHANNEL_NAME_LENGTH + 1??) = "\0";

    pUAS = (UserAreaStruct *) & (ChannelDef_ptr->SecurityUserData??(0??));
}

$ indent -gnu tstf3.c
$ cat tstf3.c
{
  MQCHAR cChannelName ? ? (MQ_CHANNEL_NAME_LENGTH + 1 ? ?) = "\0";

  pUAS = (UserAreaStruct *) & (ChannelDef_ptr->SecurityUserData ? ? (0 ? ?));
}


$ cat $tstf3b.c
{
    MQCHAR cChannelName??(MQ_CHANNEL_NAME_LENGTH + 1??) = "\0";

    pUAS = (UserAreaStruct *) & (ChannelDef_ptr->SecurityUserData??(0??));
}

$ indent -bap -bad -bli0 -nbc -npsl -di1 -i4 -ci4 -npcs -ss -c40 -cd40 -cp1 
-ts4 -sob -nlp tstf3b.c
$ cat tstf3b.c
{
 MQCHAR cChannelName ? ? (MQ_CHANNEL_NAME_LENGTH + 1 ? ?) = "\0";

 pUAS =
   (UserAreaStruct *) & (ChannelDef_ptr->SecurityUserData ? ? (0 ? ?));
}
===============================================================================

Can you specify which option (if any) touches the '?'s ?  Apparently it is
not "-pcs" which is part of "-gnu" and that puts a space between a function
call name and the '(' : because in my second example I specify "-npcs" with
the same results.

BTW we use GNU indent here because we have a wide range of different
platforms, and each vendor's tool works a bit differently; so we try using
one that is portable.

Thanx,

---------------------------------------------------------------------------
This  message  (including  any  attachments)  is  confidential  and  may be
privileged.  If you have received it by mistake please notify the sender by
return  e-mail  and  delete this message from your system. Any unauthorised
use  or  dissemination  of  this  message  in  whole or in part is strictly
prohibited.  Please  note  that e-mails are susceptible to change. ABN AMRO
Bank  N.V.  (including  its  group  companies)  shall not be liable for the
improper  or  incomplete  transmission of the information contained in this
communication  nor  for  any delay in its receipt or damage to your system.
ABN  AMRO  Bank  N.V.  (or its group companies) does not guarantee that the
integrity   of  this  communication  has  been  maintained  nor  that  this
communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]