[Iup-users] IupSetAttributes FGCOLOR

2018-03-11 Thread Pete Lomax via Iup-users
Quick query: Is this supposed to work? Is it a bug in my wrapper? (I am still 
using 3.23)

Ihandle buy_label = IupLabel("BUY")
IupSetAttribute(buy_label,"FGCOLOR","#008000")  -- works
IupSetAttributes(buy_label,"FGCOLOR=#008000")  -- does not work

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] Warnings output from "parse-build.lua build-mint-cd.txt >cd-mint-summary.out"

2018-03-11 Thread sur-behoffski

On 03/12/18 09:27, sur-behoffski wrote:

G'day,
[...]


Following on from my previous message, here is the output from building
CD (from the Subversion repository head, revision 744, not the tarball)
on a Linux Mint system.

The "format not a string literal" messages strewn across the "pptx.c"
driver (Microsoft(R) Office Open Power Point XML format) are an
immediate surprise:  The first occurrence seems to be reasonable code:

static void printOpenSlideRels(FILE* slideRelsFile)
{
  const char *rels =
  {
"\n"
"(... second line, relationships stuff...)">\n"
"(...third line, more relationships and schemas stuff...)\n"
  };

  fprintf(slideRelsFile, rels);
}

(The fprintf line is line 115... the compiler doesn't believe that
"rels" is a string literal.)

This warning can be suppressed simply by changing Line 108, from:

  const char *rels =

to:

  const char * const rels =

and that's it.

(Incidentally, the "C" purist in me looks askance at the C++-style
curly braces in the initialisation, as the preprocessor/compiler
knows to concatenate consecutive string literals; however, we're
looking to only make minimal-risk changes at first, so I'll bite
my tongue (just).)

Just adding "const" as we have above would eliminate about 20
compiler warnings.

For the record, Linux Mint 18.3 has gcc 5.4.x; Gentoo Linux has
gcc 6.4.x and comes up with some differences in the diagnostics.

You can see all the Linux Mint-platform diagnostics in the
attached file.

cheers,

s-b etc.
programmer, Grouse Software
* No diagnostics for:
   #include expects "FILENAME" or 
   missing binary operator before token "("
is deprecated [-Wdeprecated-declarations]
is deprecated: Use  instead [-Wdeprecated-declarations]
   comparison between  and  [-Wenum-compare]
   format  expects argument of type , but argument  has type 
 [-Wformat=]
   too many arguments for format [-Wformat-extra-args]
   assignment from incompatible pointer type [-Wincompatible-pointer-types]
   cast to pointer from integer of different size [-Wint-to-pointer-cast]
is usually a function [-Wmain]
   missing braces around initializer [-Wmissing-braces]
   the use of `tmpnam' is dangerous, better use `mkstemp'
   suggest parentheses around assignment used as truth value [-Wparentheses]
   suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
   suggest parentheses around '&&' within '||' [-Wparentheses]
   cast from pointer to integer of different size [-Wpointer-to-int-cast]
will be initialized after [-Wreorder]
   no return statement in function returning non-void [-Wreturn-type]
   control reaches end of non-void function [-Wreturn-type]
   case value  not in enumerated type  [-Wswitch]
   this 'for' clause does not guard... [-Wmisleading-indentation]
   this 'if' clause does not guard... [-Wmisleading-indentation]
   dereferencing type-punned pointer will break strict-aliasing rules 
[-Wstrict-aliasing]
   enumeration value  not handled in switch [-Wswitch]
defined but not used [-Wunused-const-variable=]
defined but not used [-Wunused-function]
   ignoring return value of , declared with attribute warn_unused_result 
[-Wunused-result]
defined but not used [-Wunused-variable]
   unused variable  [-Wunused-variable]
   variable  set but not used [-Wunused-but-set-variable]
   warning: ISO C++ forbids converting a string constant to  
[-Wwrite-strings]
   deprecated conversion from string constant to  [-Wwrite-strings]
(End of list.)


format not a string literal and no format arguments [-Wformat-security]:
drv/pptx.c:115:[Function:printOpenSlideRels]: 
  fprintf(slideRelsFile, rels);
drv/pptx.c:130:[Function:printPresProps]: 
  fprintf(presPropsFile, presProps);
drv/pptx.c:143:[Function:printRels]: 
  fprintf(relsFile, rels);
drv/pptx.c:156:[Function:printLayoutRelsFile]: 
  fprintf(layoutRelsFile, rels);
drv/pptx.c:192:[Function:printLayoutFile]: 
  fprintf(layoutFile, rels);
drv/pptx.c:205:[Function:printOpenMasterRelsFile]: 
  fprintf(masterRelsFile, rels);
drv/pptx.c:215:[Function:printCloseMasterRelsFile]: 
  fprintf(masterRelsFile, rels);
drv/pptx.c:252:[Function:printOpenMasterFile]: 
  fprintf(masterFile, rels);
drv/pptx.c:270:[Function:printCloseMasterFile]: 
  fprintf(masterFile, rels);
drv/pptx.c:548:[Function:printThemeFile]: 
  fprintf(themeFile, rels);
drv/pptx.c:578:[Function:printPresentation]: 
  fprintf(presentationFile, presentationPrefix);
drv/pptx.c:614:[Function:printContentTypes]: 
  fprintf(ctFile, contentTypesPrefix);
drv/pptx.c:617:[Function:printContentTypes]: 
  fprintf(ctFile, contentTypesSuffix);
drv/pptx.c:643:[Function:printPptRelsFile]: 
  fprintf(pptRelsFile, relsPrefix);
drv/pptx.c:646:[Function:printPptRelsFile]: 
  fprintf(pptRelsFile, relsSuffix);
drv/pptx.c:658:[Function:printCloseSlide]: 
  fprintf(slide

[Iup-users] Next phase of my IM/CD/IUP sources project: Reducing compiler warnings

2018-03-11 Thread sur-behoffski

G'day,

I'm happy now to finally have IM and CD build without error on both
variants of Linux that I regularly run.  IUP does not build, for
different reasons, on the two systems, but I'm going to put that to
one side for the moment.

This message is to introduce a Lua script, "parse-build.lua", that
takes the compiler output, with intermingled warnings, and reworks
the output to sort the messages into categories, and presents the
reworked sets in a readable but fairly terse format, with things
like file names, function names (as applicable) and line numbers
retained to help the programmer work through the warnings.

The script is licensed using the "Permissive/MIT" License.

Here's an example of how it works:

 1. Get a copy of the sources, either the last formal release,
of perhaps the latest Subversion repository.

 2. Build the sources as per the instructions as appropriate
for your environment, but with one extra environment
change:  Use the prefix "LC_ALL=C" so diagnostics are in
(US) English and merely use ASCII characters (the script
knows a little about UTF-8 chars, but this is poorly
tested), e.g.:

$ cd source-base
$ tar xzvf im-3.12_Sources.tar.gz
$ pushd im/src
$ LC_ALL=C make >../../build/build-im-3.12.txt 2>&1
$ popd

 3. Run the script, capture the analysis in a text file, and
then study the warnings, and try to decide on how to
proceed:

$ cd build
$ ./parse-build build-im-3.12.txt >im-3.12-summary.out
$ less -M im-3.12-summary.out

I've attached the "parse-build.lua" script, and the simple "strict"
script (from lua/extras) that it uses, to this message.

In the next message, I'll look at some output from the CD build.

cheers,

sur-behoffski
programmer, Grouse Software
#!/usr/bin/env lua

--- Given the full output from a project build from some base, such as:
--
--   $ cd base
--   $ tar xzvf im-3.12_Sources.tar.gz
--   $ cd im/src
--   $ LC_ALL=C make >../../build-summary/im-make-3.12.out 2>&1
--   $ cd ../..
--
-- this script looks for warning/error messages, parses them into separate
-- categories, and reports a list of errors in each category.  This mode of
-- presentation helps prioritise/triage the messages, hiding the majority
-- of the output that comes from successful builds, and collating errors
-- by category:
--
--   cd build-summary
--   ./parse-build im-make-3.12.out
--
-- This script works ony with limited internationalisation and
-- localisation variants:  In particular, an English locale (or close
-- variant) must be used, and the character encoding must be ASCII (e.g.
-- note the use of "LC_ALL=C" in the build example above), or UTF-8.
-- The quotes around function, variable and other names vary due to the
-- character encoding, so this script looks for both variants.
--
-- @author sur-behoffski, mailto:
-- @copyright (C) 2016-2018 Grouse Software
-- @license Permissive (MIT) license [reproduced below].

--[[
This file is licensed under the terms of the MIT license reproduced
below.  This means that it is free software and can be used for any
and/or all of personal, academic and commercial purposes at absolutely
no cost.  Acknowledging previous authors would be appreciated.

===

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

===

--]]


local io = require("io")
local os = require("os")
local string = require("string")
local table  = require("table")

-- Simple script, written by Roberto Ierusalimschy, to clamp down on
-- unintended global references, usually due to a typo while composing
-- code.  This comes from the Lua site's "extras/" directory, and has
-- the same license as Lua (MIT).
require("strict")



--- Sho