A list of puns related to "GNU Compiler for Java"
Hi all,
I just accidentally learnt that you can put the package statement package x.y.z; at the beginning of a Java source file, regardless of whether the file is actually in the x/y/z folder, and although the IDE complain (VSCode in my case), the code actually compiles. I tested it with some maven project.
Now that a belief of more than 15 years of me is shattered, I have some questions:
Since when is it like this?
Why does the IDE complain and stop the code completion for the non-orthodox package? Is there a way to make that work, e.g. for VSCode?
Is it somehow related to maven, and different in vanilla Javac or other build systems?
Or, am I completely wrong and missing some point here?
β
Internet was not of much help. I appreciate your ideas.
β
Best
Right now I'm using spack. It compiles everything from scratch which takes forever.
Does conan, vcpkg, or any of the other package management repos out there provide pre-built compiler / toolchain binaries you can just download and use?
if anyone is interested in the music of JS Bach, symmetrical inversion, compilers, or custom build tool chains, please checkout the special version of the Bach 13 Part inventions I prepared using my Mozart Transposition Engine, which is part of my final project for CS50
https://kundalinisoftware.com/bach-in-the-mirror
https://www.kundalinisoftware.com/mozart-transposition-engine/
https://www.kundalinisoftware.com/piano-mirror/
https://www.kundalinisoftware.com/computer-assisted-dynamics/
https://github.com/benjaminpritchard
I started CS50 in 2020 via ED-X; I am a [non credit] extension school student, having taken 3 classes in person in Cambrdige (Game Theory / Into intellectual property / Intro Music Apprecation).
Ed-X transferred us straight into 2021, where I am working on finishing my project (i.e. the Kundalini Piano Platform) which promotes full brain development, ambidexterity & programability right from the start of a student's piano journey.
Everything is open source, and everyone is welcome to contrbute
If anyone is interested in sponsoring our efforts to open source our technology stack [or want to sponsor us for any other reason!!] please do so here:
https://github.com/sponsors/BenjaminPritchard
thank you
I am abit confused as to what this options does? (-wconversion) On the documentation : https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html.
it states that: Warn for implicit conversions that may alter a value. This includes conversions between real and integer, like
abs (x)
when
x
is
double
; conversions between signed and unsigned, like
unsigned ui = -1
; and conversions to smaller types, like
sqrtf (M_PI)
. Do not warn for explicit casts like
abs ((int) x)
and
ui = (unsigned) -1
, or if the value is not changed by the conversion like in
abs (2.0)
. Warnings about conversions between signed and unsigned integers can be disabled by using -Wno-sign-conversion.
What does this mean? Does it mean it checks for your type casting on your code? Help appreciated :)!
I use MinGW GCC C compiler in Windows. man 3 printf
leads to manual page in linux. But in Windows there isn't such thing as far as I've found.
https://gcc.gnu.org/onlinedocs/ is this link(I guess it's for GNU GCC) valid for MinGW? Or anything else?
Object o = getObject();
setObject(o);
the question is will java compiler optimize this to
setObject(getObject());
I need the gcc-10 version for some of my projects. I searched for backports, but unfortunately it doesn't have any latest edition in backports. The stable branch has version 8.3. Is there any way to upgrade this package without upgrading the whole system?
https://preview.redd.it/xg7gl3411zr61.png?width=1919&format=png&auto=webp&s=bc420f011124f1378647967d2e4d83da71d78182
https://preview.redd.it/v71aeen776381.png?width=1915&format=png&auto=webp&s=771fe8b920918d74a62ed884fe1183ee6c26afa1
Hello, I am on my early adventures with an Analog BlackFin system. The main developer is using Visual Studio for editing code, but uses VisualDSP for compiling (same files are in both projects). It's a bit hairy, for example switching debug/release overwrites some sections of the linker script that need to be manually restored.
I am trying to understand my options, is the compiler offered with VisualDSP (or CrossCore Studio) is the same compiler that is available as ADI GNU toolchain?
Do ADI-provided software modules like image and video encoders require the use of VisualDSP/CrossCore, or can they practically be linked using the open source toolchain? Thanks!
I learned today that if you initialize an integer variable in C++ so..
int a = (10, 20, 30, 40, 50)
it gets saved as if it's a stack and if you printf a
, only 50 will be printed.
I am not sure if this is considered a nuance.. but I don't know the right word for it then.
Could anyone tell me where one could learn such things about Java compiler?
I already found one here..for Overloading Overriding nuances. But what about just every feature or aspect of Java?
Nuances of Overloading and Overriding in Java/
Thanks in advance.
So I was working on a homework assignment working with C-strings (because you may have to work with legacy code one day). I included the following headers:
#include <iostream>
#include <string>
#include <iomanip>
#include <cctype>
And used the function std::strlen()
. My code compiled just fine, so I turned it in, nbd. I then try to compile it with GNU g++, and I get an error that std::strlen()
has not been defined. I had forgotten to include <cstring>
. So I was confused why it worked in MSVC and not GNU. After a little digging, I found that <cstring>
is included in (at least) <iosfwd>
, which is included in <xstring>
, which itself is included in <string>
.
I'm not very well versed in preprocessor directives yet, but I'm assuming that those subsequent headers within <string>
are conditionally included depending on the compiler used.
My questions are: Am I right to assume that previous statement - that <xstring>
and <iosfwd>
are conditionally included depending on which compiler I'm using? And if so, is it still a good idea to keep using MSVC? Does it matter? Should I change some settings to make my code more portable? And again... does it matter/am I overthinking it?
Thanks!
PS: The formatting directions are terrible on reddit. I follow them and add 4 spaces before the text I want formatted as code, and it does nothing.
PPS: Figured it out. The fancy editor has simple buttons for formatting. Please update the guidelines to reflect that!
** Context:**
ifort is 2008 compliant, and even more, they include their own mpi library to boot. This means that people who are in a fully intel environment (using ifort and intelmpi) need nothing else to compile and run coarray fortran (CAF). That said, I have had difficulties using ifort and OpenMPI and trying to compile CAF.
On the other hand, gcc/gfortran relies on the outside library OpenCoarrays, which in turn relies on being built with a specified MPI library (MPICH default, OpenMPI "should be ok", no word on IntelMPI).
The Question:
Is it reasonable for me to assume that if my source is written to the 2008 standard (as far as coarrays go) that my code is going to be portable between [gfortran with OpenCoarrays and openmpi/mpich/intelmpi] and [ifort with IntelMPI]?
Thanks for reading :)
P.S. I'm working on gaining confidence with direct MPI, so in a way, maybe my use of Coarrays will be temporary, but the syntax is just so pretty: x(1,2)[3,4] = 1337 ! this is IPC in one line, standard.
Using this simple program for example
import static org.apache.commons.lang3.StringUtils.INDEX_NOT_FOUND;
import static org.apache.commons.lang3.StringUtils.SPACE;
public class Demo {
public static void foo() {
System.out.println(SPACE + INDEX_NOT_FOUND + SPACE);
}
public static void main(String[] args) {
foo();
}
}
where INDEX_NOT_FOUND ("-1") and SPACE (" ") are coming from external library.
The library needs to be present in the classpath during compilation, in order for the program to compile
javac -cp commons-lang3-3.12.0.jar /path/to/source/code/Demo.java
After compilation, I remove the library jar from the classpath, and run the compiled program.
java -cp /path/to/source/code/ Demo
My expectation is that program execution will fail. As static members of StringUtils are imported and referenced during program execution, JVM needs to load the corresponding class from the classpath and it cannot locate the class. A NoClassDefFoundError
is expected to be thrown.
Surprisingly, the compiled program even runs fine w/o throwing any exception. The string is also printed correctly
-1
I don't understand why the program could run w/o any issue. My current guess is that java compiler in this case actually inline those imported static constants during compilation (similar to what's in C/C++). However, I don't know lots of java compiler internals. I also try to search this topic online but find little information.
Can you please let me know what is the actual reason?
Thanks in advance
I've read that what makes RISC-V so special, is that the instruction set is open, allowing anyone to implement a cpu in an fpga/silicon, and any compiler/software for it.
But if ARM's IP (verilog/vhdl and instruction set) is not open, a company can't just create software for it, no?
Also, unless this is the wrong document, looking at the Risc-V standard, I don't see any reference to timing?! i.e. wouldn't Intel's version of the chip most likely perform differently than AMDs?
https://riscv.org/specifications/
For gcc c compiler on windows mingw on sourceforge is often used but there is maybe other usable alternative with newest gcc 10+ versions in w64devkit project at
https://github.com/skeeto/w64devkit
the releases are here at
https://github.com/skeeto/w64devkit/releases
The older gcc vesion is in mingw on sourceforge at
https://sourceforge.net/projects/mingw/
The newest gcc version has these graph data output options including callgraph
-fdump-rtl-all-graph
-fdump-tree-all-graph
-fdump-ipa-all-graph
-fcallgraph-info
-fdump-analyzer-callgraph
-fdump-analyzer-exploded-graph
-fdump-analyzer-supergraph
-fdump-analyzer-state-purge
These graphviz dot and ci files for rtl,ipa,tree and ci graph data can be used with gml4gtk graph viewer with a gtk gui interface at
https://sourceforge.net/projects/gml4gtk/
For the newest analyzer graph files with html table data the gml4gtk graph program is now updated and will support it in next version 7.2
The gml4gtk graph layout program topics are documented with screenshots at
Or on a blog at
maybe w64devkit is better to use then mingw
If so, how?
Additionally: Is it worth it?
Hello!
I hope someone here can help me. I am trying to fix this error I get when compiling a program on ubuntu. I searched for the error and everyone says I need to enable c++11 with
"-std=c++11" or "-std=c++0x"
Where do I enter this though?
I tried writing it into the Makefile and got the error "Missing separator"
I tried entering it in the Terminal and it tells me "No input files"
Can someone tell me how exactly I enable this?
This is the makefile but its from a well established project on github so I doubt the error is in there?:
Makefile on github
I have been working for the last eight months during my free time on a project, which turned out to be quite a bit larger than I anticipated.
Link to repository: https://github.com/PhilipJonasFranz/SnipsCompilerGen2
The Compiler compiles my language 'Snips' to ARM assembly. The project is built from scratch, no libraries were used.
I'm still working actively on the project, but mainly for documentation, bug fixing and code cleanup.
The compiler uses the basic Lexer -> Parser -> Context Checker -> Code Generation pipeline, with a little assembly optimizer attached at the end of it.
The code is not standardized (yet) to run on other systems, it currently can be executed on a LLVM i wrote. The language is quite capable and has some neat features, like heap functionality, structs, templating, polymorphism and interfaces.
The compiler has an internal library with some useful functions and data structures.
I would love some feedback, i will probably keep working on the project for quite some time.
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.