Re: Compiling gnu diction on Cygwin
On 2022-04-06 08:59, Keith Christian wrote: Brian, Csaba, I was able to complete the compile with your assistance. Brian: I'll experiment with your suggestions of: #include and remove casts (should not normally be required or used in C) as well. Csaba: Adding the -Wall -Wpedantic -Wextra fixed the issue, thanks. This will help a great deal as I pursue troubleshooting failed C compiles. The easiest way to build is using cygport - you need to provide only the minimum necessary definitions in your .cygport script, and run: $ cygport *package*.cygport get prep to download and patch sources, and run: $ cygport *package*.cygport all to compile, build, stage, and package for Cygwin. To apply patches, edit sources under pkg-ver-rel.arch/src/..., diff edited files against files under pkg-ver-rel.arch/origsrc/... to generate each patch, and add to the PATCH_URI list in each cygport. This allows you to reuse your patches on later releases, or submit them upstream, so you do not need to apply them to later releases. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Compiling gnu diction on Cygwin
Brian, Csaba, I was able to complete the compile with your assistance. Brian: I'll experiment with your suggestions of: #include and remove casts (should not normally be required or used in C) as well. Csaba: Adding the -Wall -Wpedantic -Wextra fixed the issue, thanks. This will help a great deal as I pursue troubleshooting failed C compiles. THANKS! -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Compiling gnu diction on Cygwin
On Tue, 5 Apr 2022 at 15:27, Keith Christian wrote: > > Hi Cygwin fans, > > Version info: > Windows 10:10.0.19043 N/A Build 19043 > Cygwin: CYGWIN_NT-10.0 3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin > > I successfully compiled diction and style from this tar file, but with errors: > https://ftp.gnu.org/gnu/diction/diction-1.11.tar.gz > > Diction and style both work, but I am looking for suggestions for how > to clean up the compile errors in lines 48 - 60 below: > > 1 ./configure; make; make install (snip) Works just fine for me: $ uname -a CYGWIN_NT-10.0 AMDAHL 3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin (configure ouptput elided) (edit makefile to add missing -Wall -Wpedantic -Wextra) $ make gcc -c -I. -DSHAREDIR=\"/usr/local/share\" -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -pipe -Wall -Wpedantic -Wextra -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common ../diction.c ../getopt.h:59:14: warning: ‘optarg’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] ../diction.c:190:31: warning: array subscript has type ‘char’ [-Wchar-subscripts] 190 | if (s>sent && isalpha(*(s-1))) continue; | ^~ gcc -c -I. -DSHAREDIR=\"/usr/local/share\" -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -pipe -Wall -Wpedantic -Wextra -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common ../getopt.c ../getopt.c:147:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes] 147 | extern char *getenv (); | ^~ ../getopt.c: In function ‘_getopt_internal_r’: ../getopt.c:444:23: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual] 444 | exchange ((char **) argv, d); | ^ ../style.c:1191:18: warning: unknown conversion type character ‘(’ in format [-Wformat=] 1191 | printf(_("nominalizations %1.f% (%d)\n"), | ^~ ../style.c:40:19: note: in definition of macro ‘_’ 40 | #define _(String) String | ^~ ../style.c:1191:49: note: format string is defined here 1191 | printf(_("nominalizations %1.f% (%d)\n"), | ^ gcc -o style -g style.o sentence.o misc.o \ getopt.o getopt1.o -lm Both diction.exe and style.exe are created successfully. Csaba -- You can get very substantial performance improvements by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler So if you're looking for a completely portable, 100% standards-conformant way to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK) -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Compiling gnu diction on Cygwin
On 2022-04-05 07:27, Keith Christian wrote: I successfully compiled diction and style from this tar file, but with errors: https://ftp.gnu.org/gnu/diction/diction-1.11.tar.gz Diction and style both work, but I am looking for suggestions for how to clean up the compile errors in lines 48 - 60 below: ... 48 getopt.c:147:1: warning: function declaration isnt a prototype [-Wstrict-prototypes] 49147 | extern char *getenv (); 50| ^~ 51 getopt.c: In function _getopt_internal_r: 52 getopt.c:444:23: warning: cast discards const qualifier from pointer target type [-Wcast-qual] 53444 | exchange ((char **) argv, d); 54| ^ 55 getopt.c:467:23: warning: cast discards const qualifier from pointer target type [-Wcast-qual] 56467 | exchange ((char **) argv, d); 57| ^ 58 getopt.c:774:27: warning: cast discards const qualifier from pointer target type [-Wcast-qual] 59774 | d->__nextchar = (char *) ""; 60| ^ #include remove casts (should not normally be required or used in C) -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple